Framework Adapters
Nuxt
Payments and Checkouts made dead simple with Nuxt
Installation
Choose your preferred package manager to install the module:
pnpm add @polar-sh/nuxt
Register the module
Add the module to your nuxt.config.ts
:
Checkout
Create a Checkout handler which takes care of redirections.
Query Params
Pass query params to this route.
- productId (or productPriceId)
?productId=xxx
- productPriceId (or productId)
?productPriceId=xxx
- customerId (optional)
?productId=xxx&customerId=xxx
- customerEmail (optional)
?productId=xxx&customerEmail=janedoe@gmail.com
- customerName (optional)
?productId=xxx&customerName=Jane
- metadata (optional)
URL-Encoded JSON string
Customer Portal
Create a customer portal where your customer can view orders and subscriptions.
Webhooks
A simple utility which resolves incoming webhook payloads by signing the webhook secret properly.
Payload Handlers
The Webhook handler also supports granular handlers for easy integration.
- onCheckoutCreated: (payload) =>
- onCheckoutUpdated: (payload) =>
- onOrderCreated: (payload) =>
- onSubscriptionCreated: (payload) =>
- onSubscriptionUpdated: (payload) =>
- onSubscriptionActive: (payload) =>
- onSubscriptionCanceled: (payload) =>
- onSubscriptionRevoked: (payload) =>
- onProductCreated: (payload) =>
- onProductUpdated: (payload) =>
- onOrganizationUpdated: (payload) =>
- onBenefitCreated: (payload) =>
- onBenefitUpdated: (payload) =>
- onBenefitGrantCreated: (payload) =>
- onBenefitGrantUpdated: (payload) =>
- onBenefitGrantRevoked: (payload) =>
Was this page helpful?