[GH-ISSUE #2341] stripe plugin type is not compatible with the one in docs #9156

Closed
opened 2026-04-13 04:31:08 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @MoIbrahim10 on GitHub (Apr 17, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2341

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  • Start a new Elysia project
  • Add better-auth with stripe plugin
  • Configure better-auth with stripe

Current vs. Expected behavior

Current vs. Expected behavior
Current :
I am not able to use stripe integration

Expected :
to use stripe integration plugin

What version of Better Auth are you using?

1.2.7

Provide environment information

- OS: Windows 11
- Browser: Chrome

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

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({
  emailAndPassword: {  
    enabled: true
  },
  plugins: [
  stripe({
	stripeClient,
	stripeWebhookSecret: config.STRIPE_WEBHOOK_SECRET as string,
	createCustomerOnSignUp: true 
 })
]
});

Additional context

Type '{ id: "stripe"; endpoints: { stripeWebhook: { (inputCtx_0?: ({ body?: undefined; } & { method?: "POST" | undefined; } & { query?: Record<string, any> | undefined; } & ... 4 more ... & { ...; }) | undefined): Promise<...>; options: { ...; } & ...' is not assignable to type 'BetterAuthPlugin'.
Types of property 'init' are incompatible.
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?: { password?: { hash?: ((password: string) => Promise) | undefined; verify?: ((data: { password: string; hash: string; }) => Promise<...>) | undefined; config?: { ...; } | undefined; checkPassword?: ((userId: string, c: GenericEndpointContext) => Promise<...>) | undefi...'.
Types of parameters 'ctx' and 'ctx' are incompatible.

Originally created by @MoIbrahim10 on GitHub (Apr 17, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2341 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce - Start a new Elysia project - Add better-auth with stripe plugin - Configure better-auth with stripe ### Current vs. Expected behavior Current vs. Expected behavior Current : I am not able to use stripe integration Expected : to use stripe integration plugin ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash - OS: Windows 11 - Browser: Chrome ``` ### Which area(s) are affected? (Select all that apply) 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({ emailAndPassword: { enabled: true }, plugins: [ stripe({ stripeClient, stripeWebhookSecret: config.STRIPE_WEBHOOK_SECRET as string, createCustomerOnSignUp: true }) ] }); ``` ### Additional context Type '{ id: "stripe"; endpoints: { stripeWebhook: { <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({ body?: undefined; } & { method?: "POST" | undefined; } & { query?: Record<string, any> | undefined; } & ... 4 more ... & { ...; }) | undefined): Promise<...>; options: { ...; } & ...' is not assignable to type 'BetterAuthPlugin'. Types of property 'init' are incompatible. 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?: { password?: { hash?: ((password: string) => Promise<string>) | undefined; verify?: ((data: { password: string; hash: string; }) => Promise<...>) | undefined; config?: { ...; } | undefined; checkPassword?: ((userId: string, c: GenericEndpointContext) => Promise<...>) | undefi...'. Types of parameters 'ctx' and 'ctx' are incompatible.
GiteaMirror added the lockedbug labels 2026-04-13 04:31:08 -05:00
Author
Owner

@meeladdawood commented on GitHub (Apr 20, 2025):

check the version of the stripe plugin, you probably have a mismatch between your "@better-auth/stripe" and "better-auth" make sure both at 1.2.7. rm -rf node_modules and that should do it

<!-- gh-comment-id:2816922433 --> @meeladdawood commented on GitHub (Apr 20, 2025): check the version of the stripe plugin, you probably have a mismatch between your `"@better-auth/stripe"` and `"better-auth"` make sure both at 1.2.7. rm -rf node_modules and that should do it
Author
Owner

@MoIbrahim10 commented on GitHub (Apr 21, 2025):

check the version of the stripe plugin, you probably have a mismatch between your "@better-auth/stripe" and "better-auth" make sure both at 1.2.7. rm -rf node_modules and that should do it

Still not working

<!-- gh-comment-id:2818755498 --> @MoIbrahim10 commented on GitHub (Apr 21, 2025): > check the version of the stripe plugin, you probably have a mismatch between your `"@better-auth/stripe"` and `"better-auth"` make sure both at 1.2.7. rm -rf node_modules and that should do it Still not working
Author
Owner

@wranglerdev commented on GitHub (Apr 24, 2025):

check the version of the stripe plugin, you probably have a mismatch between your "@better-auth/stripe" and "better-auth" make sure both at 1.2.7. rm -rf node_modules and that should do it

This worked for me, I'm using pnpm, better-auth": "^1.2.7" and "@better-auth/stripe": "^1.2.7"

<!-- gh-comment-id:2827874807 --> @wranglerdev commented on GitHub (Apr 24, 2025): > check the version of the stripe plugin, you probably have a mismatch between your `"@better-auth/stripe"` and `"better-auth"` make sure both at 1.2.7. rm -rf node_modules and that should do it This worked for me, I'm using pnpm, better-auth": "^1.2.7" and "@better-auth/stripe": "^1.2.7"
Author
Owner

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

Hey everyone, are we still facing this issue?
Is everyone on latest?

<!-- gh-comment-id:3049015033 --> @ping-maxwell commented on GitHub (Jul 8, 2025): Hey everyone, are we still facing this issue? Is everyone on latest?
Author
Owner

@dagmawibabi commented on GitHub (Jul 15, 2025):

@meeladdawood are you facing this issue?

<!-- gh-comment-id:3076009417 --> @dagmawibabi commented on GitHub (Jul 15, 2025): @meeladdawood are you facing this issue?
Author
Owner

@aguidis commented on GitHub (Jul 20, 2025):

@meeladdawood, thanks for the advice. In my case, after having installed @better-auth/stripe on my existing better-auth project, I faced the same issue as @MoIbrahim10. rm -rf node_modules worked.

<!-- gh-comment-id:3094730951 --> @aguidis commented on GitHub (Jul 20, 2025): @meeladdawood, thanks for the advice. In my case, after having installed `@better-auth/stripe` on my existing better-auth project, I faced the same issue as @MoIbrahim10. `rm -rf node_modules` worked.
Author
Owner

@jackwatters45 commented on GitHub (Aug 13, 2025):

This was the issue for me as well. Currently @better-auth/stripe is on release 1.3.6 while better-auth is 1.3.5. Switching both to 1.3.5 resolved the issue.

<!-- gh-comment-id:3182775397 --> @jackwatters45 commented on GitHub (Aug 13, 2025): This was the issue for me as well. Currently @better-auth/stripe is on release 1.3.6 while better-auth is 1.3.5. Switching both to 1.3.5 resolved the issue.
Author
Owner

@MoIbrahim10 commented on GitHub (Aug 14, 2025):

Issue is solved thank you all

<!-- gh-comment-id:3190123157 --> @MoIbrahim10 commented on GitHub (Aug 14, 2025): Issue is solved thank you all
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9156