fix types

This commit is contained in:
Yudi Xiao 2025-10-13 18:00:33 +08:00
parent d87ad8f1af
commit e5b7ff5d63
3 changed files with 35 additions and 35 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "@bowong/better-auth-stripe", "name": "@bowong/better-auth-stripe",
"author": "Bowong", "author": "Bowong",
"version": "1.4.1", "version": "1.4.0-beta.10",
"main": "dist/index.cjs", "main": "dist/index.cjs",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@ -1,4 +1,4 @@
import type { BetterAuthClientPlugin } from "better-auth"; import {type BetterAuthClientPlugin} from "better-auth";
import type {stripe} from "./index"; import type {stripe} from "./index";
export const stripeClient = < export const stripeClient = <
@ -7,7 +7,7 @@ export const stripeClient = <
}, },
>( >(
options?: O, options?: O,
) => { ): BetterAuthClientPlugin => {
return { return {
id: "stripe-client", id: "stripe-client",
$InferServerPlugin: {} as ReturnType< $InferServerPlugin: {} as ReturnType<

View File

@ -1,7 +1,7 @@
import { import {
type GenericEndpointContext, type GenericEndpointContext,
type BetterAuthPlugin, type BetterAuthPlugin,
logger, logger, type BetterAuthClientPlugin,
} from "better-auth"; } from "better-auth";
import {createAuthEndpoint, createAuthMiddleware} from "better-auth/plugins"; import {createAuthEndpoint, createAuthMiddleware} from "better-auth/plugins";
import Stripe from "stripe"; import Stripe from "stripe";
@ -64,7 +64,7 @@ async function resolvePriceIdFromLookupKey(
return prices.data[0]?.id; return prices.data[0]?.id;
} }
export const stripe = <O extends StripeOptions>(options: O) => { export const stripe = <O extends StripeOptions>(options: O) : BetterAuthPlugin => {
const client = options.stripeClient; const client = options.stripeClient;
const referenceMiddleware = ( const referenceMiddleware = (