From 362df86d78b3e89681819f39679ce73432ca2ac1 Mon Sep 17 00:00:00 2001 From: Igor Makowski <56691628+Mnigos@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:09:13 +0100 Subject: [PATCH] docs(dodopayments): use checkoutSession in docs (#8501) --- docs/content/docs/plugins/dodopayments.mdx | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/docs/content/docs/plugins/dodopayments.mdx b/docs/content/docs/plugins/dodopayments.mdx index d1acf94770..126917454f 100644 --- a/docs/content/docs/plugins/dodopayments.mdx +++ b/docs/content/docs/plugins/dodopayments.mdx @@ -99,6 +99,7 @@ export const auth = betterAuth({ Create or update `src/lib/auth-client.ts`: ```typescript +import { createAuthClient } from "better-auth/react"; import { dodopaymentsClient } from "@dodopayments/better-auth"; export const authClient = createAuthClient({ @@ -114,27 +115,21 @@ export const authClient = createAuthClient({ ### Creating a Checkout Session ```typescript -const { data: checkout, error } = await authClient.dodopayments.checkout({ +const { data: checkoutSession, error } = + await authClient.dodopayments.checkoutSession({ slug: "premium-plan", - customer: { - email: "customer@example.com", - name: "John Doe", - }, - billing: { - city: "San Francisco", - country: "US", - state: "CA", - street: "123 Market St", - zipcode: "94103", - }, - referenceId: "order_123", }); -if (checkout) { - window.location.href = checkout.url; +if (checkoutSession) { + window.location.href = checkoutSession.url; } ``` + + `authClient.dodopayments.checkout()` is deprecated. Use + `authClient.dodopayments.checkoutSession()` for new integrations. + + ### Accessing the Customer Portal ```typescript