From 73dca10e5a7608e25fdffd85e1f1f63859f99d26 Mon Sep 17 00:00:00 2001 From: Emil Widlund Date: Mon, 19 May 2025 17:29:32 +0200 Subject: [PATCH] docs: fix minor polar documentation issues --- docs/content/docs/plugins/polar.mdx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/content/docs/plugins/polar.mdx b/docs/content/docs/plugins/polar.mdx index 8a36935bb1..80aebd75b7 100644 --- a/docs/content/docs/plugins/polar.mdx +++ b/docs/content/docs/plugins/polar.mdx @@ -132,8 +132,10 @@ const auth = betterAuth({ polar({ client: polarClient, createCustomerOnSignUp: true, - getCustomerCreateParams: ({ user, session }, request) => ({ - myCustomProperty: 123, + getCustomerCreateParams: ({ user }, request) => ({ + metadata: { + myCustomProperty: 123, + }, }), use: [ // This is where you add Polar plugins @@ -156,7 +158,7 @@ const auth = betterAuth({ When `createCustomerOnSignUp` is enabled, a new Polar Customer is automatically created when a new User is added in the Better-Auth Database. -All new customers are created with an associated `externalId`, which is the ID of your User in the Database. This allows us to skip any Polar User mapping in your Database. +All new customers are created with an associated `externalId`, which is the ID of your User in the Database. This allows us to skip any Polar to User mapping in your Database. ## Checkout Plugin @@ -211,7 +213,7 @@ await authClient.checkout({ // Any Polar Product ID can be passed here products: ["e651f46d-ac20-4f26-b769-ad088b123df2"], // Or, if you setup "products" in the Checkout Config, you can pass the slug - slug: 'my-pro-product', + slug: 'pro', // Reference ID will be saved as `referenceId` in the metadata of the checkout, order & subscription object referenceId: organizationId }); @@ -306,7 +308,7 @@ const { data: orders } = await authClient.customer.orders.list({ This method lists the subscriptions associated with authenticated user/customer. ```typescript -const { data: subscriptions } = await authClient.customer.orders.list({ +const { data: subscriptions } = await authClient.customer.subscriptions.list({ query: { page: 1, limit: 10, @@ -464,6 +466,3 @@ The plugin supports handlers for all Polar webhook events: - `onCustomerUpdated` - Triggered when a customer is updated - `onCustomerDeleted` - Triggered when a customer is deleted - `onCustomerStateChanged` - Triggered when a customer is created - - -For configuration options and more information, check out [Polar's Better Auth docs](https://docs.polar.sh/integrate/sdk/adapters/better-auth).