mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 20:27:44 +00:00
docs: remove unused schema from stripe docs
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
oAuthProxy,
|
oAuthProxy,
|
||||||
openAPI,
|
openAPI,
|
||||||
oidcProvider,
|
oidcProvider,
|
||||||
|
customSession,
|
||||||
} from "better-auth/plugins";
|
} from "better-auth/plugins";
|
||||||
import { reactInvitationEmail } from "./email/invitation";
|
import { reactInvitationEmail } from "./email/invitation";
|
||||||
import { LibsqlDialect } from "@libsql/kysely-libsql";
|
import { LibsqlDialect } from "@libsql/kysely-libsql";
|
||||||
@@ -160,6 +161,15 @@ export const auth = betterAuth({
|
|||||||
loginPage: "/sign-in",
|
loginPage: "/sign-in",
|
||||||
}),
|
}),
|
||||||
oneTap(),
|
oneTap(),
|
||||||
|
customSession(async (session) => {
|
||||||
|
return {
|
||||||
|
...session,
|
||||||
|
user: {
|
||||||
|
...session.user,
|
||||||
|
dd: "test",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}),
|
||||||
stripe({
|
stripe({
|
||||||
stripeClient: new Stripe(process.env.STRIPE_KEY!),
|
stripeClient: new Stripe(process.env.STRIPE_KEY!),
|
||||||
stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
|
stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
|
||||||
|
|||||||
@@ -404,39 +404,18 @@ You can configure trial periods for your plans:
|
|||||||
|
|
||||||
The Stripe plugin adds the following tables to your database:
|
The Stripe plugin adds the following tables to your database:
|
||||||
|
|
||||||
### Customer
|
|
||||||
|
|
||||||
Table Name: `customer`
|
### User
|
||||||
|
|
||||||
|
Table Name: `user`
|
||||||
|
|
||||||
<DatabaseTable
|
<DatabaseTable
|
||||||
fields={[
|
fields={[
|
||||||
{
|
|
||||||
name: "id",
|
|
||||||
type: "string",
|
|
||||||
description: "Unique identifier for each customer",
|
|
||||||
isPrimaryKey: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "stripeCustomerId",
|
name: "stripeCustomerId",
|
||||||
type: "string",
|
type: "string",
|
||||||
description: "The Stripe customer ID"
|
description: "The Stripe customer ID"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "userId",
|
|
||||||
type: "string",
|
|
||||||
description: "The user ID this customer is associated with",
|
|
||||||
isForeignKey: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "createdAt",
|
|
||||||
type: "Date",
|
|
||||||
description: "Timestamp of when the customer was created"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "updatedAt",
|
|
||||||
type: "Date",
|
|
||||||
description: "Timestamp of when the customer was last updated"
|
|
||||||
}
|
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -529,12 +508,6 @@ To change the schema table names or fields, you can pass a `schema` option to th
|
|||||||
stripe({
|
stripe({
|
||||||
// ... other options
|
// ... other options
|
||||||
schema: {
|
schema: {
|
||||||
customer: {
|
|
||||||
modelName: "stripeCustomers", // map the customer table to stripeCustomers
|
|
||||||
fields: {
|
|
||||||
stripeCustomerId: "externalId" // map the stripeCustomerId field to externalId
|
|
||||||
}
|
|
||||||
},
|
|
||||||
subscription: {
|
subscription: {
|
||||||
modelName: "stripeSubscriptions", // map the subscription table to stripeSubscriptions
|
modelName: "stripeSubscriptions", // map the subscription table to stripeSubscriptions
|
||||||
fields: {
|
fields: {
|
||||||
|
|||||||
Reference in New Issue
Block a user