Stripe integration with nuxt doesn't work #786

Closed
opened 2026-03-13 08:04:16 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @davidabou on GitHub (Mar 5, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Start new nuxt project
  2. Add better-auth to the project
  3. Configure better-auth with stripe

Current vs. Expected behavior

Current :
And I don't have the subscription property on client.

Expected :
Have the subscription property on client.

What version of Better Auth are you using?

1.2.0

Provide environment information

- OS: Windows 11
- Browser: Firefox

Which area(s) are affected? (Select all that apply)

Types, Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
import { stripe } from "@better-auth/stripe"
import Stripe from "stripe"
 
const stripeClient = new Stripe(process.env.STRIPE_SECRET_KEY!)

export const auth = betterAuth({
  baseURL: process.env.BETTER_AUTH_URL!,
  database: prismaAdapter(prisma, { provider: 'postgresql' }),
  emailAndPassword: { enabled: true },
  socialProviders: {
    github: {
      clientId: process.env.GITHUB_CLIENT_ID!,
      clientSecret: process.env.GITHUB_CLIENT_SECRET!
    }
  },
  user: {
    deleteUser: { enabled: true }
  },
  account: {
    accountLinking: { enabled: true, allowDifferentEmails: true }
  },
  plugins: [
    stripe({
      stripeClient,
      stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
      createCustomerOnSignUp: true,
    })
  ]
})

Additional context

I'm currently working with nuxt.

Here is a part of my better auth client instance :

import { createAuthClient } from 'better-auth/vue'
import { stripeClient } from '@better-auth/stripe/client'

const client = createAuthClient({
    baseURL: url.origin,
    fetchOptions: { headers },
        plugins: [
            stripeClient({ subscription: true })
        ]
  })

And I have this error on the line 8 :

Type '{ id: "stripe-client"; $InferServerPlugin: { id: "stripe"; endpoints: { stripeWebhook: { <C extends [({ body?: undefined; method?: "POST" | undefined; query?: Record<string, any> | undefined; params?: Record<string, any> | undefined; request?: Request | undefined; headers?: HeadersInit | undefined; asResponse?: bool...' is not assignable to type 'BetterAuthClientPlugin'.
  The types of '$InferServerPlugin.init' are incompatible between these types.
    Type '(ctx: AuthContext) => { options: { databaseHooks: { user: { create: { after(user: { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | ... 1 more ... | undefined; }, ctx: GenericEndpointContext | undefined): Promise<...>; }; }; }; }; }' is not assignable to type '(ctx: AuthContext) => void | { context?: { baseURL?: string | undefined; appName?: string | undefined; secret?: string | undefined; secondaryStorage?: { get?: ((key: string) => string | ... 1 more ... | null) | undefined; set?: ((key: string, value: string, ttl?: number | undefined) => void | Promise<...>) | undefin...'.
      Types of parameters 'ctx' and 'ctx' are incompatible.

And I don't have the subscription property on client.

Originally created by @davidabou on GitHub (Mar 5, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Start new nuxt project 2. Add better-auth to the project 3. Configure better-auth with stripe ### Current vs. Expected behavior **Current :** And I don't have the `subscription` property on client. **Expected :** Have the `subscription` property on client. ### What version of Better Auth are you using? 1.2.0 ### Provide environment information ```bash - OS: Windows 11 - Browser: Firefox ``` ### Which area(s) are affected? (Select all that apply) Types, Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" import { stripe } from "@better-auth/stripe" import Stripe from "stripe" const stripeClient = new Stripe(process.env.STRIPE_SECRET_KEY!) export const auth = betterAuth({ baseURL: process.env.BETTER_AUTH_URL!, database: prismaAdapter(prisma, { provider: 'postgresql' }), emailAndPassword: { enabled: true }, socialProviders: { github: { clientId: process.env.GITHUB_CLIENT_ID!, clientSecret: process.env.GITHUB_CLIENT_SECRET! } }, user: { deleteUser: { enabled: true } }, account: { accountLinking: { enabled: true, allowDifferentEmails: true } }, plugins: [ stripe({ stripeClient, stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!, createCustomerOnSignUp: true, }) ] }) ``` ### Additional context I'm currently working with nuxt. Here is a part of my better auth client instance : ```ts import { createAuthClient } from 'better-auth/vue' import { stripeClient } from '@better-auth/stripe/client' const client = createAuthClient({ baseURL: url.origin, fetchOptions: { headers }, plugins: [ stripeClient({ subscription: true }) ] }) ``` And I have this error on the line 8 : ``` Type '{ id: "stripe-client"; $InferServerPlugin: { id: "stripe"; endpoints: { stripeWebhook: { <C extends [({ body?: undefined; method?: "POST" | undefined; query?: Record<string, any> | undefined; params?: Record<string, any> | undefined; request?: Request | undefined; headers?: HeadersInit | undefined; asResponse?: bool...' is not assignable to type 'BetterAuthClientPlugin'. The types of '$InferServerPlugin.init' are incompatible between these types. Type '(ctx: AuthContext) => { options: { databaseHooks: { user: { create: { after(user: { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | ... 1 more ... | undefined; }, ctx: GenericEndpointContext | undefined): Promise<...>; }; }; }; }; }' is not assignable to type '(ctx: AuthContext) => void | { context?: { baseURL?: string | undefined; appName?: string | undefined; secret?: string | undefined; secondaryStorage?: { get?: ((key: string) => string | ... 1 more ... | null) | undefined; set?: ((key: string, value: string, ttl?: number | undefined) => void | Promise<...>) | undefin...'. Types of parameters 'ctx' and 'ctx' are incompatible. ``` And I don't have the `subscription` property on client.
GiteaMirror added the bug label 2026-03-13 08:04:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 12, 2025):

Hi, @nethriis. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported an issue with integrating Stripe into a Nuxt project using the Better Auth library.
  • The subscription property is missing on the client, affecting both types and backend functionalities.
  • The issue seems related to the configuration of the Better Auth client instance, particularly with the Stripe plugin.
  • There have been no comments or developments on this issue yet.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jun 12, 2025): Hi, @nethriis. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You reported an issue with integrating Stripe into a Nuxt project using the Better Auth library. - The `subscription` property is missing on the client, affecting both types and backend functionalities. - The issue seems related to the configuration of the Better Auth client instance, particularly with the Stripe plugin. - There have been no comments or developments on this issue yet. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of the better-auth repository by commenting here. - If there is no further activity, this issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@Kinfe123 commented on GitHub (Jun 14, 2025):

can you please show me your tsconfig if this actually an issue ?

@Kinfe123 commented on GitHub (Jun 14, 2025): can you please show me your tsconfig if this actually an issue ?
Author
Owner

@ping-maxwell commented on GitHub (Aug 8, 2025):

Closing as stale

@ping-maxwell commented on GitHub (Aug 8, 2025): Closing as stale
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#786