better-auth 0.2.2 → 0.2.3-beta.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.
@@ -0,0 +1,827 @@
1
+ import * as arctic from 'arctic';
2
+ import { OAuth2Tokens } from 'arctic';
3
+ import { z } from 'zod';
4
+ import { L as LiteralString, P as Prettify } from './helper-C1ihmerM.js';
5
+
6
+ declare const accountSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ providerId: z.ZodString;
9
+ accountId: z.ZodString;
10
+ userId: z.ZodString;
11
+ accessToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ refreshToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ idToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ /**
15
+ * Access token expires at
16
+ */
17
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
18
+ /**
19
+ * Password is only stored in the credential provider
20
+ */
21
+ password: z.ZodNullable<z.ZodOptional<z.ZodString>>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ id: string;
24
+ providerId: string;
25
+ accountId: string;
26
+ userId: string;
27
+ accessToken?: string | null | undefined;
28
+ refreshToken?: string | null | undefined;
29
+ idToken?: string | null | undefined;
30
+ expiresAt?: Date | null | undefined;
31
+ password?: string | null | undefined;
32
+ }, {
33
+ id: string;
34
+ providerId: string;
35
+ accountId: string;
36
+ userId: string;
37
+ accessToken?: string | null | undefined;
38
+ refreshToken?: string | null | undefined;
39
+ idToken?: string | null | undefined;
40
+ expiresAt?: Date | null | undefined;
41
+ password?: string | null | undefined;
42
+ }>;
43
+ declare const userSchema: z.ZodObject<{
44
+ id: z.ZodString;
45
+ email: z.ZodEffects<z.ZodString, string, string>;
46
+ emailVerified: z.ZodDefault<z.ZodBoolean>;
47
+ name: z.ZodString;
48
+ image: z.ZodOptional<z.ZodString>;
49
+ createdAt: z.ZodDefault<z.ZodDate>;
50
+ updatedAt: z.ZodDefault<z.ZodDate>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ id: string;
53
+ email: string;
54
+ emailVerified: boolean;
55
+ name: string;
56
+ createdAt: Date;
57
+ updatedAt: Date;
58
+ image?: string | undefined;
59
+ }, {
60
+ id: string;
61
+ email: string;
62
+ name: string;
63
+ emailVerified?: boolean | undefined;
64
+ image?: string | undefined;
65
+ createdAt?: Date | undefined;
66
+ updatedAt?: Date | undefined;
67
+ }>;
68
+ declare const sessionSchema: z.ZodObject<{
69
+ id: z.ZodString;
70
+ userId: z.ZodString;
71
+ expiresAt: z.ZodDate;
72
+ ipAddress: z.ZodOptional<z.ZodString>;
73
+ userAgent: z.ZodOptional<z.ZodString>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ id: string;
76
+ userId: string;
77
+ expiresAt: Date;
78
+ ipAddress?: string | undefined;
79
+ userAgent?: string | undefined;
80
+ }, {
81
+ id: string;
82
+ userId: string;
83
+ expiresAt: Date;
84
+ ipAddress?: string | undefined;
85
+ userAgent?: string | undefined;
86
+ }>;
87
+ type User = z.infer<typeof userSchema>;
88
+ type Account = z.infer<typeof accountSchema>;
89
+ type Session = z.infer<typeof sessionSchema>;
90
+
91
+ interface TwitterProfile {
92
+ data: {
93
+ /**
94
+ * Unique identifier of this user. This is returned as a string in order to avoid complications with languages and tools
95
+ * that cannot handle large integers.
96
+ */
97
+ id: string;
98
+ /** The friendly name of this user, as shown on their profile. */
99
+ name: string;
100
+ /** @note Email is currently unsupported by Twitter. */
101
+ email?: string;
102
+ /** The Twitter handle (screen name) of this user. */
103
+ username: string;
104
+ /**
105
+ * The location specified in the user's profile, if the user provided one.
106
+ * As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries.
107
+ *
108
+ * To return this field, add `user.fields=location` in the authorization request's query parameter.
109
+ */
110
+ location?: string;
111
+ /**
112
+ * This object and its children fields contain details about text that has a special meaning in the user's description.
113
+ *
114
+ *To return this field, add `user.fields=entities` in the authorization request's query parameter.
115
+ */
116
+ entities?: {
117
+ /** Contains details about the user's profile website. */
118
+ url: {
119
+ /** Contains details about the user's profile website. */
120
+ urls: Array<{
121
+ /** The start position (zero-based) of the recognized user's profile website. All start indices are inclusive. */
122
+ start: number;
123
+ /** The end position (zero-based) of the recognized user's profile website. This end index is exclusive. */
124
+ end: number;
125
+ /** The URL in the format entered by the user. */
126
+ url: string;
127
+ /** The fully resolved URL. */
128
+ expanded_url: string;
129
+ /** The URL as displayed in the user's profile. */
130
+ display_url: string;
131
+ }>;
132
+ };
133
+ /** Contains details about URLs, Hashtags, Cashtags, or mentions located within a user's description. */
134
+ description: {
135
+ hashtags: Array<{
136
+ start: number;
137
+ end: number;
138
+ tag: string;
139
+ }>;
140
+ };
141
+ };
142
+ /**
143
+ * Indicate if this user is a verified Twitter user.
144
+ *
145
+ * To return this field, add `user.fields=verified` in the authorization request's query parameter.
146
+ */
147
+ verified?: boolean;
148
+ /**
149
+ * The text of this user's profile description (also known as bio), if the user provided one.
150
+ *
151
+ * To return this field, add `user.fields=description` in the authorization request's query parameter.
152
+ */
153
+ description?: string;
154
+ /**
155
+ * The URL specified in the user's profile, if present.
156
+ *
157
+ * To return this field, add `user.fields=url` in the authorization request's query parameter.
158
+ */
159
+ url?: string;
160
+ /** The URL to the profile image for this user, as shown on the user's profile. */
161
+ profile_image_url?: string;
162
+ protected?: boolean;
163
+ /**
164
+ * Unique identifier of this user's pinned Tweet.
165
+ *
166
+ * You can obtain the expanded object in `includes.tweets` by adding `expansions=pinned_tweet_id` in the authorization request's query parameter.
167
+ */
168
+ pinned_tweet_id?: string;
169
+ created_at?: string;
170
+ };
171
+ includes?: {
172
+ tweets?: Array<{
173
+ id: string;
174
+ text: string;
175
+ }>;
176
+ };
177
+ [claims: string]: unknown;
178
+ }
179
+ interface TwitterOption {
180
+ clientId: string;
181
+ clientSecret: string;
182
+ redirectURI?: string;
183
+ }
184
+ declare const twitter: (options: TwitterOption) => {
185
+ id: "twitter";
186
+ name: string;
187
+ createAuthorizationURL(data: {
188
+ state: string;
189
+ codeVerifier: string;
190
+ scopes?: string[];
191
+ redirectURI?: string;
192
+ }): URL;
193
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
194
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
195
+ user: {
196
+ id: string;
197
+ name: string;
198
+ email: string;
199
+ image: string | undefined;
200
+ emailVerified: boolean;
201
+ };
202
+ data: TwitterProfile;
203
+ } | null>;
204
+ };
205
+
206
+ interface TwitchProfile {
207
+ /**
208
+ * The sub of the user
209
+ */
210
+ sub: string;
211
+ /**
212
+ * The preferred username of the user
213
+ */
214
+ preferred_username: string;
215
+ /**
216
+ * The email of the user
217
+ */
218
+ email: string;
219
+ /**
220
+ * The picture of the user
221
+ */
222
+ picture: string;
223
+ }
224
+ interface TwitchOptions {
225
+ clientId: string;
226
+ clientSecret: string;
227
+ redirectURI?: string;
228
+ }
229
+ declare const twitch: (options: TwitchOptions) => {
230
+ id: "twitch";
231
+ name: string;
232
+ createAuthorizationURL({ state, scopes }: {
233
+ state: string;
234
+ codeVerifier: string;
235
+ scopes?: string[];
236
+ redirectURI?: string;
237
+ }): URL;
238
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
239
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
240
+ user: {
241
+ id: string;
242
+ name: string;
243
+ email: string;
244
+ image: string;
245
+ emailVerified: false;
246
+ };
247
+ data: TwitchProfile;
248
+ } | null>;
249
+ };
250
+
251
+ interface SpotifyProfile {
252
+ id: string;
253
+ display_name: string;
254
+ email: string;
255
+ images: {
256
+ url: string;
257
+ }[];
258
+ }
259
+ interface SpotifyOptions {
260
+ clientId: string;
261
+ clientSecret: string;
262
+ redirectURI?: string;
263
+ }
264
+ declare const spotify: (options: SpotifyOptions) => {
265
+ id: "spotify";
266
+ name: string;
267
+ createAuthorizationURL({ state, scopes }: {
268
+ state: string;
269
+ codeVerifier: string;
270
+ scopes?: string[];
271
+ redirectURI?: string;
272
+ }): URL;
273
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
274
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
275
+ user: {
276
+ id: string;
277
+ name: string;
278
+ email: string;
279
+ image: string;
280
+ emailVerified: false;
281
+ };
282
+ data: SpotifyProfile;
283
+ } | null>;
284
+ };
285
+
286
+ interface GoogleProfile {
287
+ aud: string;
288
+ azp: string;
289
+ email: string;
290
+ email_verified: boolean;
291
+ exp: number;
292
+ /**
293
+ * The family name of the user, or last name in most
294
+ * Western languages.
295
+ */
296
+ family_name: string;
297
+ given_name: string;
298
+ hd?: string;
299
+ iat: number;
300
+ iss: string;
301
+ jti?: string;
302
+ locale?: string;
303
+ name: string;
304
+ nbf?: number;
305
+ picture: string;
306
+ sub: string;
307
+ }
308
+ interface GoogleOptions extends ProviderOptions {
309
+ }
310
+ declare const google: (options: GoogleOptions) => {
311
+ id: "google";
312
+ name: string;
313
+ createAuthorizationURL({ state, scopes, codeVerifier, redirectURI }: {
314
+ state: string;
315
+ codeVerifier: string;
316
+ scopes?: string[];
317
+ redirectURI?: string;
318
+ }): URL;
319
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
320
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
321
+ user: {
322
+ id: string;
323
+ name: string;
324
+ email: string;
325
+ image: string;
326
+ emailVerified: boolean;
327
+ };
328
+ data: GoogleProfile;
329
+ } | null>;
330
+ };
331
+
332
+ interface GithubProfile {
333
+ login: string;
334
+ id: string;
335
+ node_id: string;
336
+ avatar_url: string;
337
+ gravatar_id: string;
338
+ url: string;
339
+ html_url: string;
340
+ followers_url: string;
341
+ following_url: string;
342
+ gists_url: string;
343
+ starred_url: string;
344
+ subscriptions_url: string;
345
+ organizations_url: string;
346
+ repos_url: string;
347
+ events_url: string;
348
+ received_events_url: string;
349
+ type: string;
350
+ site_admin: boolean;
351
+ name: string;
352
+ company: string;
353
+ blog: string;
354
+ location: string;
355
+ email: string;
356
+ hireable: boolean;
357
+ bio: string;
358
+ twitter_username: string;
359
+ public_repos: string;
360
+ public_gists: string;
361
+ followers: string;
362
+ following: string;
363
+ created_at: string;
364
+ updated_at: string;
365
+ private_gists: string;
366
+ total_private_repos: string;
367
+ owned_private_repos: string;
368
+ disk_usage: string;
369
+ collaborators: string;
370
+ two_factor_authentication: boolean;
371
+ plan: {
372
+ name: string;
373
+ space: string;
374
+ private_repos: string;
375
+ collaborators: string;
376
+ };
377
+ first_name: string;
378
+ last_name: string;
379
+ }
380
+ interface GithubOptions {
381
+ clientId: string;
382
+ clientSecret: string;
383
+ redirectURI?: string;
384
+ }
385
+ declare const github: ({ clientId, clientSecret, redirectURI, }: GithubOptions) => {
386
+ id: "github";
387
+ name: string;
388
+ createAuthorizationURL({ state, scopes }: {
389
+ state: string;
390
+ codeVerifier: string;
391
+ scopes?: string[];
392
+ redirectURI?: string;
393
+ }): URL;
394
+ validateAuthorizationCode: (state: string) => Promise<arctic.OAuth2Tokens>;
395
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
396
+ user: {
397
+ id: string;
398
+ name: string;
399
+ email: string;
400
+ image: string;
401
+ emailVerified: boolean;
402
+ createdAt: Date;
403
+ updatedAt: Date;
404
+ };
405
+ data: GithubProfile;
406
+ } | null>;
407
+ };
408
+
409
+ interface FacebookProfile {
410
+ id: string;
411
+ name: string;
412
+ email: string;
413
+ email_verified: boolean;
414
+ picture: {
415
+ data: {
416
+ height: number;
417
+ is_silhouette: boolean;
418
+ url: string;
419
+ width: number;
420
+ };
421
+ };
422
+ }
423
+ interface FacebookOptions {
424
+ clientId: string;
425
+ clientSecret: string;
426
+ redirectURI?: string;
427
+ }
428
+ declare const facebook: (options: FacebookOptions) => {
429
+ id: "facebook";
430
+ name: string;
431
+ createAuthorizationURL({ state, scopes }: {
432
+ state: string;
433
+ codeVerifier: string;
434
+ scopes?: string[];
435
+ redirectURI?: string;
436
+ }): URL;
437
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
438
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
439
+ user: {
440
+ id: string;
441
+ name: string;
442
+ email: string;
443
+ emailVerified: boolean;
444
+ };
445
+ data: FacebookProfile;
446
+ } | null>;
447
+ };
448
+
449
+ interface DiscordProfile extends Record<string, any> {
450
+ /** the user's id (i.e. the numerical snowflake) */
451
+ id: string;
452
+ /** the user's username, not unique across the platform */
453
+ username: string;
454
+ /** the user's Discord-tag */
455
+ discriminator: string;
456
+ /** the user's display name, if it is set */
457
+ global_name: string | null;
458
+ /**
459
+ * the user's avatar hash:
460
+ * https://discord.com/developers/docs/reference#image-formatting
461
+ */
462
+ avatar: string | null;
463
+ /** whether the user belongs to an OAuth2 application */
464
+ bot?: boolean;
465
+ /**
466
+ * whether the user is an Official Discord System user (part of the urgent
467
+ * message system)
468
+ */
469
+ system?: boolean;
470
+ /** whether the user has two factor enabled on their account */
471
+ mfa_enabled: boolean;
472
+ /**
473
+ * the user's banner hash:
474
+ * https://discord.com/developers/docs/reference#image-formatting
475
+ */
476
+ banner: string | null;
477
+ /** the user's banner color encoded as an integer representation of hexadecimal color code */
478
+ accent_color: number | null;
479
+ /**
480
+ * the user's chosen language option:
481
+ * https://discord.com/developers/docs/reference#locales
482
+ */
483
+ locale: string;
484
+ /** whether the email on this account has been verified */
485
+ verified: boolean;
486
+ /** the user's email */
487
+ email: string;
488
+ /**
489
+ * the flags on a user's account:
490
+ * https://discord.com/developers/docs/resources/user#user-object-user-flags
491
+ */
492
+ flags: number;
493
+ /**
494
+ * the type of Nitro subscription on a user's account:
495
+ * https://discord.com/developers/docs/resources/user#user-object-premium-types
496
+ */
497
+ premium_type: number;
498
+ /**
499
+ * the public flags on a user's account:
500
+ * https://discord.com/developers/docs/resources/user#user-object-user-flags
501
+ */
502
+ public_flags: number;
503
+ /** undocumented field; corresponds to the user's custom nickname */
504
+ display_name: string | null;
505
+ /**
506
+ * undocumented field; corresponds to the Discord feature where you can e.g.
507
+ * put your avatar inside of an ice cube
508
+ */
509
+ avatar_decoration: string | null;
510
+ /**
511
+ * undocumented field; corresponds to the premium feature where you can
512
+ * select a custom banner color
513
+ */
514
+ banner_color: string | null;
515
+ /** undocumented field; the CDN URL of their profile picture */
516
+ image_url: string;
517
+ }
518
+ interface DiscordOptions {
519
+ clientId: string;
520
+ clientSecret: string;
521
+ redirectURI?: string;
522
+ }
523
+ declare const discord: (options: DiscordOptions) => {
524
+ id: "discord";
525
+ name: string;
526
+ createAuthorizationURL({ state, scopes }: {
527
+ state: string;
528
+ codeVerifier: string;
529
+ scopes?: string[];
530
+ redirectURI?: string;
531
+ }): URL;
532
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
533
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
534
+ user: {
535
+ id: string;
536
+ name: string;
537
+ email: string;
538
+ emailVerified: boolean;
539
+ };
540
+ data: DiscordProfile;
541
+ } | null>;
542
+ };
543
+
544
+ interface AppleProfile {
545
+ /**
546
+ * The subject registered claim identifies the principal that’s the subject
547
+ * of the identity token. Because this token is for your app, the value is
548
+ * the unique identifier for the user.
549
+ */
550
+ sub: string;
551
+ /**
552
+ * A String value representing the user's email address.
553
+ * The email address is either the user's real email address or the proxy
554
+ * address, depending on their status private email relay service.
555
+ */
556
+ email: string;
557
+ /**
558
+ * A string or Boolean value that indicates whether the service verifies
559
+ * the email. The value can either be a string ("true" or "false") or a
560
+ * Boolean (true or false). The system may not verify email addresses for
561
+ * Sign in with Apple at Work & School users, and this claim is "false" or
562
+ * false for those users.
563
+ */
564
+ email_verified: true | "true";
565
+ /**
566
+ * A string or Boolean value that indicates whether the email that the user
567
+ * shares is the proxy address. The value can either be a string ("true" or
568
+ * "false") or a Boolean (true or false).
569
+ */
570
+ is_private_email: boolean;
571
+ /**
572
+ * An Integer value that indicates whether the user appears to be a real
573
+ * person. Use the value of this claim to mitigate fraud. The possible
574
+ * values are: 0 (or Unsupported), 1 (or Unknown), 2 (or LikelyReal). For
575
+ * more information, see ASUserDetectionStatus. This claim is present only
576
+ * in iOS 14 and later, macOS 11 and later, watchOS 7 and later, tvOS 14
577
+ * and later. The claim isn’t present or supported for web-based apps.
578
+ */
579
+ real_user_status: number;
580
+ /**
581
+ * The user’s full name in the format provided during the authorization
582
+ * process.
583
+ */
584
+ name: string;
585
+ }
586
+ interface AppleOptions {
587
+ clientId: string;
588
+ clientSecret: string;
589
+ redirectURI?: string;
590
+ }
591
+ declare const apple: (options: AppleOptions) => {
592
+ id: "apple";
593
+ name: string;
594
+ createAuthorizationURL({ state, scopes, redirectURI }: {
595
+ state: string;
596
+ codeVerifier: string;
597
+ scopes?: string[];
598
+ redirectURI?: string;
599
+ }): URL;
600
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<OAuth2Tokens>;
601
+ getUserInfo(token: OAuth2Tokens): Promise<{
602
+ user: {
603
+ id: string;
604
+ name: string;
605
+ email: string;
606
+ emailVerified: boolean;
607
+ };
608
+ data: AppleProfile;
609
+ } | null>;
610
+ };
611
+
612
+ interface OAuthProvider<T extends Record<string, any> = Record<string, any>> {
613
+ id: LiteralString;
614
+ createAuthorizationURL: (data: {
615
+ state: string;
616
+ codeVerifier: string;
617
+ scopes?: string[];
618
+ redirectURI?: string;
619
+ }) => URL;
620
+ name: string;
621
+ validateAuthorizationCode: (code: string, codeVerifier?: string, redirectURI?: string) => Promise<OAuth2Tokens>;
622
+ getUserInfo: (token: OAuth2Tokens) => Promise<{
623
+ user: Omit<User, "createdAt" | "updatedAt">;
624
+ data: T;
625
+ } | null>;
626
+ refreshAccessToken?: (refreshToken: string) => Promise<OAuth2Tokens>;
627
+ revokeToken?: (token: string) => Promise<void>;
628
+ }
629
+ type OAuthProviderList = typeof oAuthProviderList;
630
+ type ProviderOptions = {
631
+ /**
632
+ * The client ID of your application
633
+ */
634
+ clientId: string;
635
+ /**
636
+ * The client secret of your application
637
+ */
638
+ clientSecret: string;
639
+ /**
640
+ * The scopes you want to request from the provider
641
+ */
642
+ scope?: string[];
643
+ /**
644
+ * The redirect URL for your application. This is where the provider will
645
+ * redirect the user after the sign in process. Make sure this URL is
646
+ * whitelisted in the provider's dashboard.
647
+ */
648
+ redirectURI?: string;
649
+ };
650
+
651
+ declare const oAuthProviders: {
652
+ apple: (options: AppleOptions) => {
653
+ id: "apple";
654
+ name: string;
655
+ createAuthorizationURL({ state, scopes, redirectURI }: {
656
+ state: string;
657
+ codeVerifier: string;
658
+ scopes?: string[];
659
+ redirectURI?: string;
660
+ }): URL;
661
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
662
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
663
+ user: {
664
+ id: string;
665
+ name: string;
666
+ email: string;
667
+ emailVerified: boolean;
668
+ };
669
+ data: AppleProfile;
670
+ } | null>;
671
+ };
672
+ discord: (options: DiscordOptions) => {
673
+ id: "discord";
674
+ name: string;
675
+ createAuthorizationURL({ state, scopes }: {
676
+ state: string;
677
+ codeVerifier: string;
678
+ scopes?: string[];
679
+ redirectURI?: string;
680
+ }): URL;
681
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
682
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
683
+ user: {
684
+ id: string;
685
+ name: string;
686
+ email: string;
687
+ emailVerified: boolean;
688
+ };
689
+ data: DiscordProfile;
690
+ } | null>;
691
+ };
692
+ facebook: (options: FacebookOptions) => {
693
+ id: "facebook";
694
+ name: string;
695
+ createAuthorizationURL({ state, scopes }: {
696
+ state: string;
697
+ codeVerifier: string;
698
+ scopes?: string[];
699
+ redirectURI?: string;
700
+ }): URL;
701
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
702
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
703
+ user: {
704
+ id: string;
705
+ name: string;
706
+ email: string;
707
+ emailVerified: boolean;
708
+ };
709
+ data: FacebookProfile;
710
+ } | null>;
711
+ };
712
+ github: ({ clientId, clientSecret, redirectURI, }: GithubOptions) => {
713
+ id: "github";
714
+ name: string;
715
+ createAuthorizationURL({ state, scopes }: {
716
+ state: string;
717
+ codeVerifier: string;
718
+ scopes?: string[];
719
+ redirectURI?: string;
720
+ }): URL;
721
+ validateAuthorizationCode: (state: string) => Promise<arctic.OAuth2Tokens>;
722
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
723
+ user: {
724
+ id: string;
725
+ name: string;
726
+ email: string;
727
+ image: string;
728
+ emailVerified: boolean;
729
+ createdAt: Date;
730
+ updatedAt: Date;
731
+ };
732
+ data: GithubProfile;
733
+ } | null>;
734
+ };
735
+ google: (options: GoogleOptions) => {
736
+ id: "google";
737
+ name: string;
738
+ createAuthorizationURL({ state, scopes, codeVerifier, redirectURI }: {
739
+ state: string;
740
+ codeVerifier: string;
741
+ scopes?: string[];
742
+ redirectURI?: string;
743
+ }): URL;
744
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
745
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
746
+ user: {
747
+ id: string;
748
+ name: string;
749
+ email: string;
750
+ image: string;
751
+ emailVerified: boolean;
752
+ };
753
+ data: GoogleProfile;
754
+ } | null>;
755
+ };
756
+ spotify: (options: SpotifyOptions) => {
757
+ id: "spotify";
758
+ name: string;
759
+ createAuthorizationURL({ state, scopes }: {
760
+ state: string;
761
+ codeVerifier: string;
762
+ scopes?: string[];
763
+ redirectURI?: string;
764
+ }): URL;
765
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
766
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
767
+ user: {
768
+ id: string;
769
+ name: string;
770
+ email: string;
771
+ image: string;
772
+ emailVerified: false;
773
+ };
774
+ data: SpotifyProfile;
775
+ } | null>;
776
+ };
777
+ twitch: (options: TwitchOptions) => {
778
+ id: "twitch";
779
+ name: string;
780
+ createAuthorizationURL({ state, scopes }: {
781
+ state: string;
782
+ codeVerifier: string;
783
+ scopes?: string[];
784
+ redirectURI?: string;
785
+ }): URL;
786
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
787
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
788
+ user: {
789
+ id: string;
790
+ name: string;
791
+ email: string;
792
+ image: string;
793
+ emailVerified: false;
794
+ };
795
+ data: TwitchProfile;
796
+ } | null>;
797
+ };
798
+ twitter: (options: TwitterOption) => {
799
+ id: "twitter";
800
+ name: string;
801
+ createAuthorizationURL(data: {
802
+ state: string;
803
+ codeVerifier: string;
804
+ scopes?: string[];
805
+ redirectURI?: string;
806
+ }): URL;
807
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
808
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
809
+ user: {
810
+ id: string;
811
+ name: string;
812
+ email: string;
813
+ image: string | undefined;
814
+ emailVerified: boolean;
815
+ };
816
+ data: TwitterProfile;
817
+ } | null>;
818
+ };
819
+ };
820
+ declare const oAuthProviderList: ["github", ...(keyof typeof oAuthProviders)[]];
821
+ type SocialProviders = typeof oAuthProviders extends {
822
+ [key in infer K]: infer V;
823
+ } ? V extends (options: infer V) => any ? Partial<Record<K, Prettify<V & {
824
+ enabled?: boolean;
825
+ }>>> : never : never;
826
+
827
+ export { type Account as A, type DiscordProfile as D, type FacebookProfile as F, type GithubProfile as G, type OAuthProvider as O, type ProviderOptions as P, type Session as S, type TwitchProfile as T, type User as U, type AppleProfile as a, type GoogleProfile as b, type SpotifyProfile as c, type TwitterProfile as d, type SocialProviders as e, type OAuthProviderList as f, oAuthProviderList as g, type GithubOptions as h, github as i, type GoogleOptions as j, google as k, type AppleOptions as l, apple as m, type DiscordOptions as n, oAuthProviders as o, discord as p, type SpotifyOptions as q, type TwitchOptions as r, spotify as s, twitch as t, type FacebookOptions as u, facebook as v, type TwitterOption as w, twitter as x };