[GH-ISSUE #4267] Stripe subscription methods missing from auth.api with latest v1.3.7 #9878

Closed
opened 2026-04-13 05:40:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @seanlucakrueger on GitHub (Aug 27, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4267

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

`### Version

  • better-auth: 1.3.7
  • @better-auth/stripe: (latest)

Repro Steps

Server-side:

const subscriptions = await auth.api.listActiveSubscriptions({
  query: { referenceId: "123" },
  headers: await headers(),
});`



### Current vs. Expected behavior

**Expected Behavior**
	•      Both server-side and client-side should expose Stripe subscription methods (e.g. listActiveSubscriptions, subscription.list, etc.).
	•	Or, the documentation should clearly specify that Stripe subscription APIs are only available on the client.

**Actual Behavior**
	•	listActiveSubscriptions does not exist on auth.api
	•	TypeScript error: Property 'listActiveSubscriptions' does not exist on type 'Api'.


### What version of Better Auth are you using?

1.3.7

### System info

```bash
System:
    OS: macOS 15.6.1
    CPU: (14) arm64 Apple M4 Pro
    Memory: 1.35 GB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 139.0.7258.139
    Safari: 18.6

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

Package, Backend

Auth config (if applicable)

/* eslint-disable @typescript-eslint/no-unused-vars */
import { betterAuth } from "better-auth";
import { createPool } from "mysql2/promise";
import { admin, createAuthMiddleware } from "better-auth/plugins";
import { organization } from "better-auth/plugins";
import { openAPI } from "better-auth/plugins";
import { ac, pro, basic } from "@/lib/permission";
import { anonymous } from "better-auth/plugins";
import { query } from "@/lib/database";
import { sendAccountDeleteEmail, sendOrganizationInvitation, sendPasswordResetEmail, sendVerificationEmail } from "./mail";
import { stripe } from "@better-auth/stripe";
import Stripe from "stripe";

const stripeClient = new Stripe("", {
	apiVersion: "2025-07-30.basil",
});

export const auth = betterAuth({
	appName: "Test",
	database: createPool({
		// connection options
		host: process.env.MYSQL_HOST,
		user: process.env.MYSQL_USER,
		password: process.env.MYSQL_PASSWORD,
		port: process.env.MYSQL_PORT as unknown as number,
		database: process.env.MYSQL_DATABASE,
	}),
	
	emailAndPassword: {
		enabled: true,
		autoSignIn: true, //defaults to true
		sendResetPassword: async ({ user, url, token }, request) => {
			await sendPasswordResetEmail({
				to: user.email,
				subject: "Reset your password",
				link: url,
			});
		},
	},

	
	plugins: [
		stripe({
			stripeClient,
			stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
			createCustomerOnSignUp: true,

			subscription: {
				enabled: true,
				plans: [-- CLEARED --]
                        }
		}),
		admin(),

		openAPI(),
		
		
	],
	trustedOrigins: ["http://localhost:3000"],

	
	},
});

Additional context

No response

Originally created by @seanlucakrueger on GitHub (Aug 27, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4267 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce `### Version - better-auth: 1.3.7 - @better-auth/stripe: (latest) ### Repro Steps Server-side: ```ts const subscriptions = await auth.api.listActiveSubscriptions({ query: { referenceId: "123" }, headers: await headers(), });` ### Current vs. Expected behavior **Expected Behavior** • Both server-side and client-side should expose Stripe subscription methods (e.g. listActiveSubscriptions, subscription.list, etc.). • Or, the documentation should clearly specify that Stripe subscription APIs are only available on the client. **Actual Behavior** • listActiveSubscriptions does not exist on auth.api • TypeScript error: Property 'listActiveSubscriptions' does not exist on type 'Api'. ### What version of Better Auth are you using? 1.3.7 ### System info ```bash System: OS: macOS 15.6.1 CPU: (14) arm64 Apple M4 Pro Memory: 1.35 GB / 24.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 139.0.7258.139 Safari: 18.6 ``` ### Which area(s) are affected? (Select all that apply) Package, Backend ### Auth config (if applicable) ```typescript /* eslint-disable @typescript-eslint/no-unused-vars */ import { betterAuth } from "better-auth"; import { createPool } from "mysql2/promise"; import { admin, createAuthMiddleware } from "better-auth/plugins"; import { organization } from "better-auth/plugins"; import { openAPI } from "better-auth/plugins"; import { ac, pro, basic } from "@/lib/permission"; import { anonymous } from "better-auth/plugins"; import { query } from "@/lib/database"; import { sendAccountDeleteEmail, sendOrganizationInvitation, sendPasswordResetEmail, sendVerificationEmail } from "./mail"; import { stripe } from "@better-auth/stripe"; import Stripe from "stripe"; const stripeClient = new Stripe("", { apiVersion: "2025-07-30.basil", }); export const auth = betterAuth({ appName: "Test", database: createPool({ // connection options host: process.env.MYSQL_HOST, user: process.env.MYSQL_USER, password: process.env.MYSQL_PASSWORD, port: process.env.MYSQL_PORT as unknown as number, database: process.env.MYSQL_DATABASE, }), emailAndPassword: { enabled: true, autoSignIn: true, //defaults to true sendResetPassword: async ({ user, url, token }, request) => { await sendPasswordResetEmail({ to: user.email, subject: "Reset your password", link: url, }); }, }, plugins: [ stripe({ stripeClient, stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!, createCustomerOnSignUp: true, subscription: { enabled: true, plans: [-- CLEARED --] } }), admin(), openAPI(), ], trustedOrigins: ["http://localhost:3000"], }, }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 05:40:38 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 27, 2025):

Hi @seanlucakrueger! I'm Dosu and I’m helping the better-auth team.

Stripe subscription methods like listActiveSubscriptions, upgradeSubscription, and others are intended to be available on auth.api (server-side) when the Stripe plugin is registered with subscription.enabled: true in your config. The code and docs confirm these endpoints are merged onto auth.api and should be callable on both server and client when set up correctly (source).

If you're seeing a TypeScript error that listActiveSubscriptions does not exist on auth.api, the most common causes are:

  • Version mismatch between better-auth and @better-auth/stripe. Both packages must be on the exact same version (source).
  • Inconsistent or incomplete Stripe plugin config, especially in the plans array (all plans must have the same shape) (source).
  • Not clearing node_modules and reinstalling after updating versions or config (source).

To resolve:

  1. Make sure both better-auth and @better-auth/stripe are on version 1.3.7.
  2. Double-check your Stripe plugin config for subscription: { enabled: true, plans: [...] } and ensure all plans are consistent.
  3. Delete node_modules and your lockfile, then reinstall dependencies.

If you follow these steps, the Stripe subscription methods should appear on auth.api as expected. If you still see issues, check for TypeScript type inference problems or plugin registration errors in your build output.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3228978246 --> @dosubot[bot] commented on GitHub (Aug 27, 2025): <!-- Greeting --> Hi @seanlucakrueger! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> Stripe subscription methods like `listActiveSubscriptions`, `upgradeSubscription`, and others are intended to be available on `auth.api` (server-side) when the Stripe plugin is registered with `subscription.enabled: true` in your config. The code and docs confirm these endpoints are merged onto `auth.api` and should be callable on both server and client when set up correctly ([source](https://github.com/better-auth/better-auth/blob/f978fe9a983c336356364e2392ffcdd99e551b2b/packages/stripe/src/index.ts)). If you're seeing a TypeScript error that `listActiveSubscriptions` does not exist on `auth.api`, the most common causes are: - Version mismatch between `better-auth` and `@better-auth/stripe`. Both packages must be on the exact same version ([source](https://github.com/better-auth/better-auth/issues/1717)). - Inconsistent or incomplete Stripe plugin config, especially in the `plans` array (all plans must have the same shape) ([source](https://github.com/better-auth/better-auth/issues/2725)). - Not clearing `node_modules` and reinstalling after updating versions or config ([source](https://github.com/better-auth/better-auth/issues/4056)). To resolve: 1. Make sure both `better-auth` and `@better-auth/stripe` are on version 1.3.7. 2. Double-check your Stripe plugin config for `subscription: { enabled: true, plans: [...] }` and ensure all plans are consistent. 3. Delete `node_modules` and your lockfile, then reinstall dependencies. If you follow these steps, the Stripe subscription methods should appear on `auth.api` as expected. If you still see issues, check for TypeScript type inference problems or plugin registration errors in your build output. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/bdd57315-7880-43b7-bcb5-3b4776c5b63d?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/bdd57315-7880-43b7-bcb5-3b4776c5b63d?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/bdd57315-7880-43b7-bcb5-3b4776c5b63d?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/bdd57315-7880-43b7-bcb5-3b4776c5b63d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/bdd57315-7880-43b7-bcb5-3b4776c5b63d?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/bdd57315-7880-43b7-bcb5-3b4776c5b63d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/bdd57315-7880-43b7-bcb5-3b4776c5b63d?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/4267)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9878