@better-auth/stripe 1.3.8-beta.9 → 1.3.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,7 @@
1
1
 
2
- > @better-auth/stripe@1.3.8-beta.9 build /home/runner/work/better-auth/better-auth/packages/stripe
2
+ > @better-auth/stripe@1.3.9-beta.1 build /home/runner/work/better-auth/better-auth/packages/stripe
3
3
  > unbuild
4
4
 
5
- Browserslist: caniuse-lite is outdated. Please run:
6
- npx update-browserslist-db@latest
7
- Why you should do it regularly: https://github.com/browserslist/update-db#readme
8
5
  [info] Automatically detected entries: src/index, src/client [esm] [cjs] [dts]
9
6
  [info] Building stripe
10
7
  [success] Build succeeded for stripe
package/dist/index.d.cts CHANGED
@@ -253,7 +253,7 @@ interface StripeOptions {
253
253
  /**
254
254
  * List of plan
255
255
  */
256
- plans: StripePlan[] | (() => Promise<StripePlan[]>);
256
+ plans: StripePlan[] | (() => StripePlan[] | Promise<StripePlan[]>);
257
257
  /**
258
258
  * Require email verification before a user is allowed to upgrade
259
259
  * their subscriptions
@@ -621,21 +621,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
621
621
  session: {
622
622
  session: Record<string, any> & {
623
623
  id: string;
624
- userId: string;
625
- expiresAt: Date;
626
624
  createdAt: Date;
627
625
  updatedAt: Date;
626
+ userId: string;
627
+ expiresAt: Date;
628
628
  token: string;
629
629
  ipAddress?: string | null | undefined;
630
630
  userAgent?: string | null | undefined;
631
631
  };
632
632
  user: Record<string, any> & {
633
633
  id: string;
634
+ createdAt: Date;
635
+ updatedAt: Date;
634
636
  email: string;
635
637
  emailVerified: boolean;
636
638
  name: string;
637
- createdAt: Date;
638
- updatedAt: Date;
639
639
  image?: string | null | undefined;
640
640
  };
641
641
  };
@@ -740,21 +740,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
740
740
  session: {
741
741
  session: Record<string, any> & {
742
742
  id: string;
743
- userId: string;
744
- expiresAt: Date;
745
743
  createdAt: Date;
746
744
  updatedAt: Date;
745
+ userId: string;
746
+ expiresAt: Date;
747
747
  token: string;
748
748
  ipAddress?: string | null | undefined;
749
749
  userAgent?: string | null | undefined;
750
750
  };
751
751
  user: Record<string, any> & {
752
752
  id: string;
753
+ createdAt: Date;
754
+ updatedAt: Date;
753
755
  email: string;
754
756
  emailVerified: boolean;
755
757
  name: string;
756
- createdAt: Date;
757
- updatedAt: Date;
758
758
  image?: string | null | undefined;
759
759
  };
760
760
  };
@@ -802,21 +802,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
802
802
  session: {
803
803
  session: Record<string, any> & {
804
804
  id: string;
805
- userId: string;
806
- expiresAt: Date;
807
805
  createdAt: Date;
808
806
  updatedAt: Date;
807
+ userId: string;
808
+ expiresAt: Date;
809
809
  token: string;
810
810
  ipAddress?: string | null | undefined;
811
811
  userAgent?: string | null | undefined;
812
812
  };
813
813
  user: Record<string, any> & {
814
814
  id: string;
815
+ createdAt: Date;
816
+ updatedAt: Date;
815
817
  email: string;
816
818
  emailVerified: boolean;
817
819
  name: string;
818
- createdAt: Date;
819
- updatedAt: Date;
820
820
  image?: string | null | undefined;
821
821
  };
822
822
  };
@@ -909,21 +909,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
909
909
  session: {
910
910
  session: Record<string, any> & {
911
911
  id: string;
912
- userId: string;
913
- expiresAt: Date;
914
912
  createdAt: Date;
915
913
  updatedAt: Date;
914
+ userId: string;
915
+ expiresAt: Date;
916
916
  token: string;
917
917
  ipAddress?: string | null | undefined;
918
918
  userAgent?: string | null | undefined;
919
919
  };
920
920
  user: Record<string, any> & {
921
921
  id: string;
922
+ createdAt: Date;
923
+ updatedAt: Date;
922
924
  email: string;
923
925
  emailVerified: boolean;
924
926
  name: string;
925
- createdAt: Date;
926
- updatedAt: Date;
927
927
  image?: string | null | undefined;
928
928
  };
929
929
  };
@@ -1039,21 +1039,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
1039
1039
  session: {
1040
1040
  session: Record<string, any> & {
1041
1041
  id: string;
1042
- userId: string;
1043
- expiresAt: Date;
1044
1042
  createdAt: Date;
1045
1043
  updatedAt: Date;
1044
+ userId: string;
1045
+ expiresAt: Date;
1046
1046
  token: string;
1047
1047
  ipAddress?: string | null | undefined;
1048
1048
  userAgent?: string | null | undefined;
1049
1049
  };
1050
1050
  user: Record<string, any> & {
1051
1051
  id: string;
1052
+ createdAt: Date;
1053
+ updatedAt: Date;
1052
1054
  email: string;
1053
1055
  emailVerified: boolean;
1054
1056
  name: string;
1055
- createdAt: Date;
1056
- updatedAt: Date;
1057
1057
  image?: string | null | undefined;
1058
1058
  };
1059
1059
  };
@@ -1071,11 +1071,11 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
1071
1071
  create: {
1072
1072
  after(user: {
1073
1073
  id: string;
1074
+ createdAt: Date;
1075
+ updatedAt: Date;
1074
1076
  email: string;
1075
1077
  emailVerified: boolean;
1076
1078
  name: string;
1077
- createdAt: Date;
1078
- updatedAt: Date;
1079
1079
  image?: string | null | undefined;
1080
1080
  } & Record<string, unknown>, ctx: GenericEndpointContext | undefined): Promise<void>;
1081
1081
  };
package/dist/index.d.mts CHANGED
@@ -253,7 +253,7 @@ interface StripeOptions {
253
253
  /**
254
254
  * List of plan
255
255
  */
256
- plans: StripePlan[] | (() => Promise<StripePlan[]>);
256
+ plans: StripePlan[] | (() => StripePlan[] | Promise<StripePlan[]>);
257
257
  /**
258
258
  * Require email verification before a user is allowed to upgrade
259
259
  * their subscriptions
@@ -621,21 +621,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
621
621
  session: {
622
622
  session: Record<string, any> & {
623
623
  id: string;
624
- userId: string;
625
- expiresAt: Date;
626
624
  createdAt: Date;
627
625
  updatedAt: Date;
626
+ userId: string;
627
+ expiresAt: Date;
628
628
  token: string;
629
629
  ipAddress?: string | null | undefined;
630
630
  userAgent?: string | null | undefined;
631
631
  };
632
632
  user: Record<string, any> & {
633
633
  id: string;
634
+ createdAt: Date;
635
+ updatedAt: Date;
634
636
  email: string;
635
637
  emailVerified: boolean;
636
638
  name: string;
637
- createdAt: Date;
638
- updatedAt: Date;
639
639
  image?: string | null | undefined;
640
640
  };
641
641
  };
@@ -740,21 +740,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
740
740
  session: {
741
741
  session: Record<string, any> & {
742
742
  id: string;
743
- userId: string;
744
- expiresAt: Date;
745
743
  createdAt: Date;
746
744
  updatedAt: Date;
745
+ userId: string;
746
+ expiresAt: Date;
747
747
  token: string;
748
748
  ipAddress?: string | null | undefined;
749
749
  userAgent?: string | null | undefined;
750
750
  };
751
751
  user: Record<string, any> & {
752
752
  id: string;
753
+ createdAt: Date;
754
+ updatedAt: Date;
753
755
  email: string;
754
756
  emailVerified: boolean;
755
757
  name: string;
756
- createdAt: Date;
757
- updatedAt: Date;
758
758
  image?: string | null | undefined;
759
759
  };
760
760
  };
@@ -802,21 +802,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
802
802
  session: {
803
803
  session: Record<string, any> & {
804
804
  id: string;
805
- userId: string;
806
- expiresAt: Date;
807
805
  createdAt: Date;
808
806
  updatedAt: Date;
807
+ userId: string;
808
+ expiresAt: Date;
809
809
  token: string;
810
810
  ipAddress?: string | null | undefined;
811
811
  userAgent?: string | null | undefined;
812
812
  };
813
813
  user: Record<string, any> & {
814
814
  id: string;
815
+ createdAt: Date;
816
+ updatedAt: Date;
815
817
  email: string;
816
818
  emailVerified: boolean;
817
819
  name: string;
818
- createdAt: Date;
819
- updatedAt: Date;
820
820
  image?: string | null | undefined;
821
821
  };
822
822
  };
@@ -909,21 +909,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
909
909
  session: {
910
910
  session: Record<string, any> & {
911
911
  id: string;
912
- userId: string;
913
- expiresAt: Date;
914
912
  createdAt: Date;
915
913
  updatedAt: Date;
914
+ userId: string;
915
+ expiresAt: Date;
916
916
  token: string;
917
917
  ipAddress?: string | null | undefined;
918
918
  userAgent?: string | null | undefined;
919
919
  };
920
920
  user: Record<string, any> & {
921
921
  id: string;
922
+ createdAt: Date;
923
+ updatedAt: Date;
922
924
  email: string;
923
925
  emailVerified: boolean;
924
926
  name: string;
925
- createdAt: Date;
926
- updatedAt: Date;
927
927
  image?: string | null | undefined;
928
928
  };
929
929
  };
@@ -1039,21 +1039,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
1039
1039
  session: {
1040
1040
  session: Record<string, any> & {
1041
1041
  id: string;
1042
- userId: string;
1043
- expiresAt: Date;
1044
1042
  createdAt: Date;
1045
1043
  updatedAt: Date;
1044
+ userId: string;
1045
+ expiresAt: Date;
1046
1046
  token: string;
1047
1047
  ipAddress?: string | null | undefined;
1048
1048
  userAgent?: string | null | undefined;
1049
1049
  };
1050
1050
  user: Record<string, any> & {
1051
1051
  id: string;
1052
+ createdAt: Date;
1053
+ updatedAt: Date;
1052
1054
  email: string;
1053
1055
  emailVerified: boolean;
1054
1056
  name: string;
1055
- createdAt: Date;
1056
- updatedAt: Date;
1057
1057
  image?: string | null | undefined;
1058
1058
  };
1059
1059
  };
@@ -1071,11 +1071,11 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
1071
1071
  create: {
1072
1072
  after(user: {
1073
1073
  id: string;
1074
+ createdAt: Date;
1075
+ updatedAt: Date;
1074
1076
  email: string;
1075
1077
  emailVerified: boolean;
1076
1078
  name: string;
1077
- createdAt: Date;
1078
- updatedAt: Date;
1079
1079
  image?: string | null | undefined;
1080
1080
  } & Record<string, unknown>, ctx: GenericEndpointContext | undefined): Promise<void>;
1081
1081
  };
package/dist/index.d.ts CHANGED
@@ -253,7 +253,7 @@ interface StripeOptions {
253
253
  /**
254
254
  * List of plan
255
255
  */
256
- plans: StripePlan[] | (() => Promise<StripePlan[]>);
256
+ plans: StripePlan[] | (() => StripePlan[] | Promise<StripePlan[]>);
257
257
  /**
258
258
  * Require email verification before a user is allowed to upgrade
259
259
  * their subscriptions
@@ -621,21 +621,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
621
621
  session: {
622
622
  session: Record<string, any> & {
623
623
  id: string;
624
- userId: string;
625
- expiresAt: Date;
626
624
  createdAt: Date;
627
625
  updatedAt: Date;
626
+ userId: string;
627
+ expiresAt: Date;
628
628
  token: string;
629
629
  ipAddress?: string | null | undefined;
630
630
  userAgent?: string | null | undefined;
631
631
  };
632
632
  user: Record<string, any> & {
633
633
  id: string;
634
+ createdAt: Date;
635
+ updatedAt: Date;
634
636
  email: string;
635
637
  emailVerified: boolean;
636
638
  name: string;
637
- createdAt: Date;
638
- updatedAt: Date;
639
639
  image?: string | null | undefined;
640
640
  };
641
641
  };
@@ -740,21 +740,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
740
740
  session: {
741
741
  session: Record<string, any> & {
742
742
  id: string;
743
- userId: string;
744
- expiresAt: Date;
745
743
  createdAt: Date;
746
744
  updatedAt: Date;
745
+ userId: string;
746
+ expiresAt: Date;
747
747
  token: string;
748
748
  ipAddress?: string | null | undefined;
749
749
  userAgent?: string | null | undefined;
750
750
  };
751
751
  user: Record<string, any> & {
752
752
  id: string;
753
+ createdAt: Date;
754
+ updatedAt: Date;
753
755
  email: string;
754
756
  emailVerified: boolean;
755
757
  name: string;
756
- createdAt: Date;
757
- updatedAt: Date;
758
758
  image?: string | null | undefined;
759
759
  };
760
760
  };
@@ -802,21 +802,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
802
802
  session: {
803
803
  session: Record<string, any> & {
804
804
  id: string;
805
- userId: string;
806
- expiresAt: Date;
807
805
  createdAt: Date;
808
806
  updatedAt: Date;
807
+ userId: string;
808
+ expiresAt: Date;
809
809
  token: string;
810
810
  ipAddress?: string | null | undefined;
811
811
  userAgent?: string | null | undefined;
812
812
  };
813
813
  user: Record<string, any> & {
814
814
  id: string;
815
+ createdAt: Date;
816
+ updatedAt: Date;
815
817
  email: string;
816
818
  emailVerified: boolean;
817
819
  name: string;
818
- createdAt: Date;
819
- updatedAt: Date;
820
820
  image?: string | null | undefined;
821
821
  };
822
822
  };
@@ -909,21 +909,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
909
909
  session: {
910
910
  session: Record<string, any> & {
911
911
  id: string;
912
- userId: string;
913
- expiresAt: Date;
914
912
  createdAt: Date;
915
913
  updatedAt: Date;
914
+ userId: string;
915
+ expiresAt: Date;
916
916
  token: string;
917
917
  ipAddress?: string | null | undefined;
918
918
  userAgent?: string | null | undefined;
919
919
  };
920
920
  user: Record<string, any> & {
921
921
  id: string;
922
+ createdAt: Date;
923
+ updatedAt: Date;
922
924
  email: string;
923
925
  emailVerified: boolean;
924
926
  name: string;
925
- createdAt: Date;
926
- updatedAt: Date;
927
927
  image?: string | null | undefined;
928
928
  };
929
929
  };
@@ -1039,21 +1039,21 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
1039
1039
  session: {
1040
1040
  session: Record<string, any> & {
1041
1041
  id: string;
1042
- userId: string;
1043
- expiresAt: Date;
1044
1042
  createdAt: Date;
1045
1043
  updatedAt: Date;
1044
+ userId: string;
1045
+ expiresAt: Date;
1046
1046
  token: string;
1047
1047
  ipAddress?: string | null | undefined;
1048
1048
  userAgent?: string | null | undefined;
1049
1049
  };
1050
1050
  user: Record<string, any> & {
1051
1051
  id: string;
1052
+ createdAt: Date;
1053
+ updatedAt: Date;
1052
1054
  email: string;
1053
1055
  emailVerified: boolean;
1054
1056
  name: string;
1055
- createdAt: Date;
1056
- updatedAt: Date;
1057
1057
  image?: string | null | undefined;
1058
1058
  };
1059
1059
  };
@@ -1071,11 +1071,11 @@ declare const stripe: <O extends StripeOptions>(options: O) => {
1071
1071
  create: {
1072
1072
  after(user: {
1073
1073
  id: string;
1074
+ createdAt: Date;
1075
+ updatedAt: Date;
1074
1076
  email: string;
1075
1077
  emailVerified: boolean;
1076
1078
  name: string;
1077
- createdAt: Date;
1078
- updatedAt: Date;
1079
1079
  image?: string | null | undefined;
1080
1080
  } & Record<string, unknown>, ctx: GenericEndpointContext | undefined): Promise<void>;
1081
1081
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@better-auth/stripe",
3
3
  "author": "Bereket Engida",
4
- "version": "1.3.8-beta.9",
4
+ "version": "1.3.9-beta.1",
5
5
  "main": "dist/index.cjs",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -37,16 +37,16 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "zod": "^4.0.0"
40
+ "zod": "^4.1.5"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "stripe": "^18",
44
- "better-auth": "1.3.8-beta.9"
44
+ "better-auth": "1.3.9-beta.1"
45
45
  },
46
46
  "devDependencies": {
47
- "better-call": "1.0.15",
48
- "stripe": "^18.0.0",
49
- "better-auth": "1.3.8-beta.9"
47
+ "better-call": "1.0.16",
48
+ "stripe": "^18.5.0",
49
+ "better-auth": "1.3.9-beta.1"
50
50
  },
51
51
  "scripts": {
52
52
  "test": "vitest",
@@ -180,7 +180,7 @@ describe("stripe", async () => {
180
180
  stripeCustomerId: expect.any(String),
181
181
  status: "incomplete",
182
182
  periodStart: undefined,
183
- cancelAtPeriodEnd: undefined,
183
+ cancelAtPeriodEnd: false,
184
184
  trialStart: undefined,
185
185
  trialEnd: undefined,
186
186
  });
package/src/types.ts CHANGED
@@ -216,7 +216,7 @@ export interface StripeOptions {
216
216
  /**
217
217
  * List of plan
218
218
  */
219
- plans: StripePlan[] | (() => Promise<StripePlan[]>);
219
+ plans: StripePlan[] | (() => StripePlan[] | Promise<StripePlan[]>);
220
220
  /**
221
221
  * Require email verification before a user is allowed to upgrade
222
222
  * their subscriptions