docs(dodopayments): use checkoutSession in docs (#8501)

This commit is contained in:
Igor Makowski
2026-03-11 10:29:56 -07:00
committed by Alex Yang
parent 67c6dc2d32
commit 362df86d78
+10 -15
View File
@@ -99,6 +99,7 @@ export const auth = betterAuth({
<Step title="Set up client-side integration">
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;
}
```
<Callout type="warn">
`authClient.dodopayments.checkout()` is deprecated. Use
`authClient.dodopayments.checkoutSession()` for new integrations.
</Callout>
### Accessing the Customer Portal
```typescript