@polar-sh/better-auth 1.1.0 → 1.1.2

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.
package/dist/index.d.cts CHANGED
@@ -176,21 +176,21 @@ declare const portal: () => (polar: Polar) => {
176
176
  session: {
177
177
  session: Record<string, any> & {
178
178
  id: string;
179
- token: string;
180
- userId: string;
181
- expiresAt: Date;
182
179
  createdAt: Date;
183
180
  updatedAt: Date;
181
+ userId: string;
182
+ expiresAt: Date;
183
+ token: string;
184
184
  ipAddress?: string | null | undefined;
185
185
  userAgent?: string | null | undefined;
186
186
  };
187
187
  user: Record<string, any> & {
188
188
  id: string;
189
- name: string;
190
- emailVerified: boolean;
191
- email: string;
192
189
  createdAt: Date;
193
190
  updatedAt: Date;
191
+ email: string;
192
+ emailVerified: boolean;
193
+ name: string;
194
194
  image?: string | null | undefined;
195
195
  };
196
196
  };
@@ -231,21 +231,21 @@ declare const portal: () => (polar: Polar) => {
231
231
  session: {
232
232
  session: Record<string, any> & {
233
233
  id: string;
234
- token: string;
235
- userId: string;
236
- expiresAt: Date;
237
234
  createdAt: Date;
238
235
  updatedAt: Date;
236
+ userId: string;
237
+ expiresAt: Date;
238
+ token: string;
239
239
  ipAddress?: string | null | undefined;
240
240
  userAgent?: string | null | undefined;
241
241
  };
242
242
  user: Record<string, any> & {
243
243
  id: string;
244
- name: string;
245
- emailVerified: boolean;
246
- email: string;
247
244
  createdAt: Date;
248
245
  updatedAt: Date;
246
+ email: string;
247
+ emailVerified: boolean;
248
+ name: string;
249
249
  image?: string | null | undefined;
250
250
  };
251
251
  };
@@ -303,21 +303,21 @@ declare const portal: () => (polar: Polar) => {
303
303
  session: {
304
304
  session: Record<string, any> & {
305
305
  id: string;
306
- token: string;
307
- userId: string;
308
- expiresAt: Date;
309
306
  createdAt: Date;
310
307
  updatedAt: Date;
308
+ userId: string;
309
+ expiresAt: Date;
310
+ token: string;
311
311
  ipAddress?: string | null | undefined;
312
312
  userAgent?: string | null | undefined;
313
313
  };
314
314
  user: Record<string, any> & {
315
315
  id: string;
316
- name: string;
317
- emailVerified: boolean;
318
- email: string;
319
316
  createdAt: Date;
320
317
  updatedAt: Date;
318
+ email: string;
319
+ emailVerified: boolean;
320
+ name: string;
321
321
  image?: string | null | undefined;
322
322
  };
323
323
  };
@@ -387,21 +387,21 @@ declare const portal: () => (polar: Polar) => {
387
387
  session: {
388
388
  session: Record<string, any> & {
389
389
  id: string;
390
- token: string;
391
- userId: string;
392
- expiresAt: Date;
393
390
  createdAt: Date;
394
391
  updatedAt: Date;
392
+ userId: string;
393
+ expiresAt: Date;
394
+ token: string;
395
395
  ipAddress?: string | null | undefined;
396
396
  userAgent?: string | null | undefined;
397
397
  };
398
398
  user: Record<string, any> & {
399
399
  id: string;
400
- name: string;
401
- emailVerified: boolean;
402
- email: string;
403
400
  createdAt: Date;
404
401
  updatedAt: Date;
402
+ email: string;
403
+ emailVerified: boolean;
404
+ name: string;
405
405
  image?: string | null | undefined;
406
406
  };
407
407
  };
@@ -463,21 +463,21 @@ declare const portal: () => (polar: Polar) => {
463
463
  session: {
464
464
  session: Record<string, any> & {
465
465
  id: string;
466
- token: string;
467
- userId: string;
468
- expiresAt: Date;
469
466
  createdAt: Date;
470
467
  updatedAt: Date;
468
+ userId: string;
469
+ expiresAt: Date;
470
+ token: string;
471
471
  ipAddress?: string | null | undefined;
472
472
  userAgent?: string | null | undefined;
473
473
  };
474
474
  user: Record<string, any> & {
475
475
  id: string;
476
- name: string;
477
- emailVerified: boolean;
478
- email: string;
479
476
  createdAt: Date;
480
477
  updatedAt: Date;
478
+ email: string;
479
+ emailVerified: boolean;
480
+ name: string;
481
481
  image?: string | null | undefined;
482
482
  };
483
483
  };
@@ -534,21 +534,21 @@ declare const usage: (_usageOptions?: UsageOptions) => (polar: Polar) => {
534
534
  session: {
535
535
  session: Record<string, any> & {
536
536
  id: string;
537
- token: string;
538
- userId: string;
539
- expiresAt: Date;
540
537
  createdAt: Date;
541
538
  updatedAt: Date;
539
+ userId: string;
540
+ expiresAt: Date;
541
+ token: string;
542
542
  ipAddress?: string | null | undefined;
543
543
  userAgent?: string | null | undefined;
544
544
  };
545
545
  user: Record<string, any> & {
546
546
  id: string;
547
- name: string;
548
- emailVerified: boolean;
549
- email: string;
550
547
  createdAt: Date;
551
548
  updatedAt: Date;
549
+ email: string;
550
+ emailVerified: boolean;
551
+ name: string;
552
552
  image?: string | null | undefined;
553
553
  };
554
554
  };
@@ -612,21 +612,21 @@ declare const usage: (_usageOptions?: UsageOptions) => (polar: Polar) => {
612
612
  session: {
613
613
  session: Record<string, any> & {
614
614
  id: string;
615
- token: string;
616
- userId: string;
617
- expiresAt: Date;
618
615
  createdAt: Date;
619
616
  updatedAt: Date;
617
+ userId: string;
618
+ expiresAt: Date;
619
+ token: string;
620
620
  ipAddress?: string | null | undefined;
621
621
  userAgent?: string | null | undefined;
622
622
  };
623
623
  user: Record<string, any> & {
624
624
  id: string;
625
- name: string;
626
- emailVerified: boolean;
627
- email: string;
628
625
  createdAt: Date;
629
626
  updatedAt: Date;
627
+ email: string;
628
+ emailVerified: boolean;
629
+ name: string;
630
630
  image?: string | null | undefined;
631
631
  };
632
632
  };
@@ -819,9 +819,9 @@ interface PolarOptions {
819
819
  * @returns
820
820
  */
821
821
  getCustomerCreateParams?: (data: {
822
- user: User;
822
+ user: Partial<User>;
823
823
  }, request?: Request) => Promise<{
824
- metadata?: Record<string, string>;
824
+ metadata?: Record<string, string | number | boolean>;
825
825
  }>;
826
826
  /**
827
827
  * Use Polar plugins
@@ -947,21 +947,21 @@ declare const polar: <O extends PolarOptions>(options: O) => {
947
947
  session: {
948
948
  session: Record<string, any> & {
949
949
  id: string;
950
- token: string;
951
- userId: string;
952
- expiresAt: Date;
953
950
  createdAt: Date;
954
951
  updatedAt: Date;
952
+ userId: string;
953
+ expiresAt: Date;
954
+ token: string;
955
955
  ipAddress?: string | null | undefined;
956
956
  userAgent?: string | null | undefined;
957
957
  };
958
958
  user: Record<string, any> & {
959
959
  id: string;
960
- name: string;
961
- emailVerified: boolean;
962
- email: string;
963
960
  createdAt: Date;
964
961
  updatedAt: Date;
962
+ email: string;
963
+ emailVerified: boolean;
964
+ name: string;
965
965
  image?: string | null | undefined;
966
966
  };
967
967
  };
@@ -1025,21 +1025,21 @@ declare const polar: <O extends PolarOptions>(options: O) => {
1025
1025
  session: {
1026
1026
  session: Record<string, any> & {
1027
1027
  id: string;
1028
- token: string;
1029
- userId: string;
1030
- expiresAt: Date;
1031
1028
  createdAt: Date;
1032
1029
  updatedAt: Date;
1030
+ userId: string;
1031
+ expiresAt: Date;
1032
+ token: string;
1033
1033
  ipAddress?: string | null | undefined;
1034
1034
  userAgent?: string | null | undefined;
1035
1035
  };
1036
1036
  user: Record<string, any> & {
1037
1037
  id: string;
1038
- name: string;
1039
- emailVerified: boolean;
1040
- email: string;
1041
1038
  createdAt: Date;
1042
1039
  updatedAt: Date;
1040
+ email: string;
1041
+ emailVerified: boolean;
1042
+ name: string;
1043
1043
  image?: string | null | undefined;
1044
1044
  };
1045
1045
  };
@@ -1087,21 +1087,21 @@ declare const polar: <O extends PolarOptions>(options: O) => {
1087
1087
  session: {
1088
1088
  session: Record<string, any> & {
1089
1089
  id: string;
1090
- token: string;
1091
- userId: string;
1092
- expiresAt: Date;
1093
1090
  createdAt: Date;
1094
1091
  updatedAt: Date;
1092
+ userId: string;
1093
+ expiresAt: Date;
1094
+ token: string;
1095
1095
  ipAddress?: string | null | undefined;
1096
1096
  userAgent?: string | null | undefined;
1097
1097
  };
1098
1098
  user: Record<string, any> & {
1099
1099
  id: string;
1100
- name: string;
1101
- emailVerified: boolean;
1102
- email: string;
1103
1100
  createdAt: Date;
1104
1101
  updatedAt: Date;
1102
+ email: string;
1103
+ emailVerified: boolean;
1104
+ name: string;
1105
1105
  image?: string | null | undefined;
1106
1106
  };
1107
1107
  };
@@ -1142,21 +1142,21 @@ declare const polar: <O extends PolarOptions>(options: O) => {
1142
1142
  session: {
1143
1143
  session: Record<string, any> & {
1144
1144
  id: string;
1145
- token: string;
1146
- userId: string;
1147
- expiresAt: Date;
1148
1145
  createdAt: Date;
1149
1146
  updatedAt: Date;
1147
+ userId: string;
1148
+ expiresAt: Date;
1149
+ token: string;
1150
1150
  ipAddress?: string | null | undefined;
1151
1151
  userAgent?: string | null | undefined;
1152
1152
  };
1153
1153
  user: Record<string, any> & {
1154
1154
  id: string;
1155
- name: string;
1156
- emailVerified: boolean;
1157
- email: string;
1158
1155
  createdAt: Date;
1159
1156
  updatedAt: Date;
1157
+ email: string;
1158
+ emailVerified: boolean;
1159
+ name: string;
1160
1160
  image?: string | null | undefined;
1161
1161
  };
1162
1162
  };
@@ -1214,21 +1214,21 @@ declare const polar: <O extends PolarOptions>(options: O) => {
1214
1214
  session: {
1215
1215
  session: Record<string, any> & {
1216
1216
  id: string;
1217
- token: string;
1218
- userId: string;
1219
- expiresAt: Date;
1220
1217
  createdAt: Date;
1221
1218
  updatedAt: Date;
1219
+ userId: string;
1220
+ expiresAt: Date;
1221
+ token: string;
1222
1222
  ipAddress?: string | null | undefined;
1223
1223
  userAgent?: string | null | undefined;
1224
1224
  };
1225
1225
  user: Record<string, any> & {
1226
1226
  id: string;
1227
- name: string;
1228
- emailVerified: boolean;
1229
- email: string;
1230
1227
  createdAt: Date;
1231
1228
  updatedAt: Date;
1229
+ email: string;
1230
+ emailVerified: boolean;
1231
+ name: string;
1232
1232
  image?: string | null | undefined;
1233
1233
  };
1234
1234
  };
@@ -1298,21 +1298,21 @@ declare const polar: <O extends PolarOptions>(options: O) => {
1298
1298
  session: {
1299
1299
  session: Record<string, any> & {
1300
1300
  id: string;
1301
- token: string;
1302
- userId: string;
1303
- expiresAt: Date;
1304
1301
  createdAt: Date;
1305
1302
  updatedAt: Date;
1303
+ userId: string;
1304
+ expiresAt: Date;
1305
+ token: string;
1306
1306
  ipAddress?: string | null | undefined;
1307
1307
  userAgent?: string | null | undefined;
1308
1308
  };
1309
1309
  user: Record<string, any> & {
1310
1310
  id: string;
1311
- name: string;
1312
- emailVerified: boolean;
1313
- email: string;
1314
1311
  createdAt: Date;
1315
1312
  updatedAt: Date;
1313
+ email: string;
1314
+ emailVerified: boolean;
1315
+ name: string;
1316
1316
  image?: string | null | undefined;
1317
1317
  };
1318
1318
  };
@@ -1374,21 +1374,21 @@ declare const polar: <O extends PolarOptions>(options: O) => {
1374
1374
  session: {
1375
1375
  session: Record<string, any> & {
1376
1376
  id: string;
1377
- token: string;
1378
- userId: string;
1379
- expiresAt: Date;
1380
1377
  createdAt: Date;
1381
1378
  updatedAt: Date;
1379
+ userId: string;
1380
+ expiresAt: Date;
1381
+ token: string;
1382
1382
  ipAddress?: string | null | undefined;
1383
1383
  userAgent?: string | null | undefined;
1384
1384
  };
1385
1385
  user: Record<string, any> & {
1386
1386
  id: string;
1387
- name: string;
1388
- emailVerified: boolean;
1389
- email: string;
1390
1387
  createdAt: Date;
1391
1388
  updatedAt: Date;
1389
+ email: string;
1390
+ emailVerified: boolean;
1391
+ name: string;
1392
1392
  image?: string | null | undefined;
1393
1393
  };
1394
1394
  };
@@ -1445,10 +1445,11 @@ declare const polar: <O extends PolarOptions>(options: O) => {
1445
1445
  databaseHooks: {
1446
1446
  user: {
1447
1447
  create: {
1448
- after: (user: better_auth.User, ctx?: better_auth.GenericEndpointContext) => Promise<void>;
1448
+ before: (user: Partial<better_auth.User>, context?: better_auth.GenericEndpointContext | undefined) => Promise<void>;
1449
+ after: (user: better_auth.User, context?: better_auth.GenericEndpointContext | undefined) => Promise<void>;
1449
1450
  };
1450
1451
  update: {
1451
- after: (user: better_auth.User, ctx?: better_auth.GenericEndpointContext) => Promise<void>;
1452
+ after: (user: better_auth.User, context?: better_auth.GenericEndpointContext | undefined) => Promise<void>;
1452
1453
  };
1453
1454
  };
1454
1455
  };