@depup/supabase__auth-js 2.99.2-depup.0

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.
Files changed (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/changes.json +5 -0
  4. package/dist/main/AuthAdminApi.d.ts +4 -0
  5. package/dist/main/AuthAdminApi.d.ts.map +1 -0
  6. package/dist/main/AuthAdminApi.js +7 -0
  7. package/dist/main/AuthAdminApi.js.map +1 -0
  8. package/dist/main/AuthClient.d.ts +4 -0
  9. package/dist/main/AuthClient.d.ts.map +1 -0
  10. package/dist/main/AuthClient.js +7 -0
  11. package/dist/main/AuthClient.js.map +1 -0
  12. package/dist/main/GoTrueAdminApi.d.ts +227 -0
  13. package/dist/main/GoTrueAdminApi.d.ts.map +1 -0
  14. package/dist/main/GoTrueAdminApi.js +596 -0
  15. package/dist/main/GoTrueAdminApi.js.map +1 -0
  16. package/dist/main/GoTrueClient.d.ts +783 -0
  17. package/dist/main/GoTrueClient.d.ts.map +1 -0
  18. package/dist/main/GoTrueClient.js +3029 -0
  19. package/dist/main/GoTrueClient.js.map +1 -0
  20. package/dist/main/index.d.ts +9 -0
  21. package/dist/main/index.d.ts.map +1 -0
  22. package/dist/main/index.js +20 -0
  23. package/dist/main/index.js.map +1 -0
  24. package/dist/main/lib/base64url.d.ts +76 -0
  25. package/dist/main/lib/base64url.d.ts.map +1 -0
  26. package/dist/main/lib/base64url.js +269 -0
  27. package/dist/main/lib/base64url.js.map +1 -0
  28. package/dist/main/lib/constants.d.ts +26 -0
  29. package/dist/main/lib/constants.d.ts.map +1 -0
  30. package/dist/main/lib/constants.js +31 -0
  31. package/dist/main/lib/constants.js.map +1 -0
  32. package/dist/main/lib/error-codes.d.ts +7 -0
  33. package/dist/main/lib/error-codes.d.ts.map +1 -0
  34. package/dist/main/lib/error-codes.js +3 -0
  35. package/dist/main/lib/error-codes.js.map +1 -0
  36. package/dist/main/lib/errors.d.ts +243 -0
  37. package/dist/main/lib/errors.d.ts.map +1 -0
  38. package/dist/main/lib/errors.js +289 -0
  39. package/dist/main/lib/errors.js.map +1 -0
  40. package/dist/main/lib/fetch.d.ts +34 -0
  41. package/dist/main/lib/fetch.d.ts.map +1 -0
  42. package/dist/main/lib/fetch.js +184 -0
  43. package/dist/main/lib/fetch.js.map +1 -0
  44. package/dist/main/lib/helpers.d.ts +91 -0
  45. package/dist/main/lib/helpers.d.ts.map +1 -0
  46. package/dist/main/lib/helpers.js +395 -0
  47. package/dist/main/lib/helpers.js.map +1 -0
  48. package/dist/main/lib/local-storage.d.ts +9 -0
  49. package/dist/main/lib/local-storage.d.ts.map +1 -0
  50. package/dist/main/lib/local-storage.js +21 -0
  51. package/dist/main/lib/local-storage.js.map +1 -0
  52. package/dist/main/lib/locks.d.ts +107 -0
  53. package/dist/main/lib/locks.d.ts.map +1 -0
  54. package/dist/main/lib/locks.js +314 -0
  55. package/dist/main/lib/locks.js.map +1 -0
  56. package/dist/main/lib/polyfills.d.ts +5 -0
  57. package/dist/main/lib/polyfills.d.ts.map +1 -0
  58. package/dist/main/lib/polyfills.js +29 -0
  59. package/dist/main/lib/polyfills.js.map +1 -0
  60. package/dist/main/lib/types.d.ts +1861 -0
  61. package/dist/main/lib/types.d.ts.map +1 -0
  62. package/dist/main/lib/types.js +23 -0
  63. package/dist/main/lib/types.js.map +1 -0
  64. package/dist/main/lib/version.d.ts +2 -0
  65. package/dist/main/lib/version.d.ts.map +1 -0
  66. package/dist/main/lib/version.js +11 -0
  67. package/dist/main/lib/version.js.map +1 -0
  68. package/dist/main/lib/web3/ethereum.d.ts +96 -0
  69. package/dist/main/lib/web3/ethereum.d.ts.map +1 -0
  70. package/dist/main/lib/web3/ethereum.js +66 -0
  71. package/dist/main/lib/web3/ethereum.js.map +1 -0
  72. package/dist/main/lib/web3/solana.d.ts +160 -0
  73. package/dist/main/lib/web3/solana.d.ts.map +1 -0
  74. package/dist/main/lib/web3/solana.js +4 -0
  75. package/dist/main/lib/web3/solana.js.map +1 -0
  76. package/dist/main/lib/webauthn.d.ts +276 -0
  77. package/dist/main/lib/webauthn.d.ts.map +1 -0
  78. package/dist/main/lib/webauthn.dom.d.ts +583 -0
  79. package/dist/main/lib/webauthn.dom.d.ts.map +1 -0
  80. package/dist/main/lib/webauthn.dom.js +4 -0
  81. package/dist/main/lib/webauthn.dom.js.map +1 -0
  82. package/dist/main/lib/webauthn.errors.d.ts +80 -0
  83. package/dist/main/lib/webauthn.errors.d.ts.map +1 -0
  84. package/dist/main/lib/webauthn.errors.js +265 -0
  85. package/dist/main/lib/webauthn.errors.js.map +1 -0
  86. package/dist/main/lib/webauthn.js +706 -0
  87. package/dist/main/lib/webauthn.js.map +1 -0
  88. package/dist/module/AuthAdminApi.d.ts +4 -0
  89. package/dist/module/AuthAdminApi.d.ts.map +1 -0
  90. package/dist/module/AuthAdminApi.js +4 -0
  91. package/dist/module/AuthAdminApi.js.map +1 -0
  92. package/dist/module/AuthClient.d.ts +4 -0
  93. package/dist/module/AuthClient.d.ts.map +1 -0
  94. package/dist/module/AuthClient.js +4 -0
  95. package/dist/module/AuthClient.js.map +1 -0
  96. package/dist/module/GoTrueAdminApi.d.ts +227 -0
  97. package/dist/module/GoTrueAdminApi.d.ts.map +1 -0
  98. package/dist/module/GoTrueAdminApi.js +593 -0
  99. package/dist/module/GoTrueAdminApi.js.map +1 -0
  100. package/dist/module/GoTrueClient.d.ts +783 -0
  101. package/dist/module/GoTrueClient.d.ts.map +1 -0
  102. package/dist/module/GoTrueClient.js +3026 -0
  103. package/dist/module/GoTrueClient.js.map +1 -0
  104. package/dist/module/index.d.ts +9 -0
  105. package/dist/module/index.d.ts.map +1 -0
  106. package/dist/module/index.js +9 -0
  107. package/dist/module/index.js.map +1 -0
  108. package/dist/module/lib/base64url.d.ts +76 -0
  109. package/dist/module/lib/base64url.d.ts.map +1 -0
  110. package/dist/module/lib/base64url.js +257 -0
  111. package/dist/module/lib/base64url.js.map +1 -0
  112. package/dist/module/lib/constants.d.ts +26 -0
  113. package/dist/module/lib/constants.d.ts.map +1 -0
  114. package/dist/module/lib/constants.js +28 -0
  115. package/dist/module/lib/constants.js.map +1 -0
  116. package/dist/module/lib/error-codes.d.ts +7 -0
  117. package/dist/module/lib/error-codes.d.ts.map +1 -0
  118. package/dist/module/lib/error-codes.js +2 -0
  119. package/dist/module/lib/error-codes.js.map +1 -0
  120. package/dist/module/lib/errors.d.ts +243 -0
  121. package/dist/module/lib/errors.d.ts.map +1 -0
  122. package/dist/module/lib/errors.js +266 -0
  123. package/dist/module/lib/errors.js.map +1 -0
  124. package/dist/module/lib/fetch.d.ts +34 -0
  125. package/dist/module/lib/fetch.d.ts.map +1 -0
  126. package/dist/module/lib/fetch.js +174 -0
  127. package/dist/module/lib/fetch.js.map +1 -0
  128. package/dist/module/lib/helpers.d.ts +91 -0
  129. package/dist/module/lib/helpers.d.ts.map +1 -0
  130. package/dist/module/lib/helpers.js +368 -0
  131. package/dist/module/lib/helpers.js.map +1 -0
  132. package/dist/module/lib/local-storage.d.ts +9 -0
  133. package/dist/module/lib/local-storage.d.ts.map +1 -0
  134. package/dist/module/lib/local-storage.js +18 -0
  135. package/dist/module/lib/local-storage.js.map +1 -0
  136. package/dist/module/lib/locks.d.ts +107 -0
  137. package/dist/module/lib/locks.d.ts.map +1 -0
  138. package/dist/module/lib/locks.js +306 -0
  139. package/dist/module/lib/locks.js.map +1 -0
  140. package/dist/module/lib/polyfills.d.ts +5 -0
  141. package/dist/module/lib/polyfills.d.ts.map +1 -0
  142. package/dist/module/lib/polyfills.js +26 -0
  143. package/dist/module/lib/polyfills.js.map +1 -0
  144. package/dist/module/lib/types.d.ts +1861 -0
  145. package/dist/module/lib/types.d.ts.map +1 -0
  146. package/dist/module/lib/types.js +20 -0
  147. package/dist/module/lib/types.js.map +1 -0
  148. package/dist/module/lib/version.d.ts +2 -0
  149. package/dist/module/lib/version.d.ts.map +1 -0
  150. package/dist/module/lib/version.js +8 -0
  151. package/dist/module/lib/version.js.map +1 -0
  152. package/dist/module/lib/web3/ethereum.d.ts +96 -0
  153. package/dist/module/lib/web3/ethereum.d.ts.map +1 -0
  154. package/dist/module/lib/web3/ethereum.js +60 -0
  155. package/dist/module/lib/web3/ethereum.js.map +1 -0
  156. package/dist/module/lib/web3/solana.d.ts +160 -0
  157. package/dist/module/lib/web3/solana.d.ts.map +1 -0
  158. package/dist/module/lib/web3/solana.js +3 -0
  159. package/dist/module/lib/web3/solana.js.map +1 -0
  160. package/dist/module/lib/webauthn.d.ts +276 -0
  161. package/dist/module/lib/webauthn.d.ts.map +1 -0
  162. package/dist/module/lib/webauthn.dom.d.ts +583 -0
  163. package/dist/module/lib/webauthn.dom.d.ts.map +1 -0
  164. package/dist/module/lib/webauthn.dom.js +3 -0
  165. package/dist/module/lib/webauthn.dom.js.map +1 -0
  166. package/dist/module/lib/webauthn.errors.d.ts +80 -0
  167. package/dist/module/lib/webauthn.errors.d.ts.map +1 -0
  168. package/dist/module/lib/webauthn.errors.js +257 -0
  169. package/dist/module/lib/webauthn.errors.js.map +1 -0
  170. package/dist/module/lib/webauthn.js +689 -0
  171. package/dist/module/lib/webauthn.js.map +1 -0
  172. package/dist/tsconfig.module.tsbuildinfo +1 -0
  173. package/dist/tsconfig.tsbuildinfo +1 -0
  174. package/package.json +56 -0
  175. package/src/AuthAdminApi.ts +5 -0
  176. package/src/AuthClient.ts +5 -0
  177. package/src/GoTrueAdminApi.ts +723 -0
  178. package/src/GoTrueClient.ts +4078 -0
  179. package/src/index.ts +13 -0
  180. package/src/lib/base64url.ts +308 -0
  181. package/src/lib/constants.ts +34 -0
  182. package/src/lib/error-codes.ts +90 -0
  183. package/src/lib/errors.ts +324 -0
  184. package/src/lib/fetch.ts +283 -0
  185. package/src/lib/helpers.ts +463 -0
  186. package/src/lib/local-storage.ts +21 -0
  187. package/src/lib/locks.ts +375 -0
  188. package/src/lib/polyfills.ts +23 -0
  189. package/src/lib/types.ts +2229 -0
  190. package/src/lib/version.ts +7 -0
  191. package/src/lib/web3/ethereum.ts +184 -0
  192. package/src/lib/web3/solana.ts +186 -0
  193. package/src/lib/webauthn.dom.ts +636 -0
  194. package/src/lib/webauthn.errors.ts +317 -0
  195. package/src/lib/webauthn.ts +946 -0
@@ -0,0 +1,1861 @@
1
+ import { AuthError } from './errors';
2
+ import { Fetch } from './fetch';
3
+ import { EIP1193Provider, EthereumSignInInput, Hex } from './web3/ethereum';
4
+ import type { SolanaSignInInput, SolanaSignInOutput } from './web3/solana';
5
+ import { ServerCredentialCreationOptions, ServerCredentialRequestOptions, WebAuthnApi } from './webauthn';
6
+ import { AuthenticationCredential, PublicKeyCredentialCreationOptionsFuture, PublicKeyCredentialRequestOptionsFuture, RegistrationCredential } from './webauthn.dom';
7
+ /** One of the providers supported by GoTrue. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`). */
8
+ export type Provider = 'apple' | 'azure' | 'bitbucket' | 'discord' | 'facebook' | 'figma' | 'github' | 'gitlab' | 'google' | 'kakao' | 'keycloak' | 'linkedin' | 'linkedin_oidc' | 'notion' | 'slack' | 'slack_oidc' | 'spotify' | 'twitch'
9
+ /** Uses OAuth 1.0a */
10
+ | 'twitter'
11
+ /** Uses OAuth 2.0 */
12
+ | 'x' | 'workos' | 'zoom' | 'fly' | `custom:${string}`;
13
+ export type AuthChangeEventMFA = 'MFA_CHALLENGE_VERIFIED';
14
+ export type AuthChangeEvent = 'INITIAL_SESSION' | 'PASSWORD_RECOVERY' | 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | AuthChangeEventMFA;
15
+ /**
16
+ * Provide your own global lock implementation instead of the default
17
+ * implementation. The function should acquire a lock for the duration of the
18
+ * `fn` async function, such that no other client instances will be able to
19
+ * hold it at the same time.
20
+ *
21
+ * @experimental
22
+ *
23
+ * @param name Name of the lock to be acquired.
24
+ * @param acquireTimeout If negative, no timeout should occur. If positive it
25
+ * should throw an Error with an `isAcquireTimeout`
26
+ * property set to true if the operation fails to be
27
+ * acquired after this much time (ms).
28
+ * @param fn The operation to execute when the lock is acquired.
29
+ */
30
+ export type LockFunc = <R>(name: string, acquireTimeout: number, fn: () => Promise<R>) => Promise<R>;
31
+ export type GoTrueClientOptions = {
32
+ url?: string;
33
+ headers?: {
34
+ [key: string]: string;
35
+ };
36
+ storageKey?: string;
37
+ /**
38
+ * Set to "true" if you want to automatically detect OAuth grants in the URL and sign in the user.
39
+ * Set to "false" to disable automatic detection.
40
+ * Set to a function to provide custom logic for determining if a URL contains a Supabase auth callback.
41
+ * The function receives the current URL and parsed parameters, and should return true if the URL
42
+ * should be processed as a Supabase auth callback, or false to ignore it.
43
+ *
44
+ * This is useful when your app uses other OAuth providers (e.g., Facebook Login) that also return
45
+ * access_token in the URL fragment, which would otherwise be incorrectly intercepted by Supabase Auth.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * detectSessionInUrl: (url, params) => {
50
+ * // Ignore Facebook OAuth redirects
51
+ * if (url.pathname === '/facebook/redirect') return false
52
+ * // Use default detection for other URLs
53
+ * return Boolean(params.access_token || params.error_description)
54
+ * }
55
+ * ```
56
+ */
57
+ detectSessionInUrl?: boolean | ((url: URL, params: {
58
+ [parameter: string]: string;
59
+ }) => boolean);
60
+ autoRefreshToken?: boolean;
61
+ persistSession?: boolean;
62
+ storage?: SupportedStorage;
63
+ /**
64
+ * Stores the user object in a separate storage location from the rest of the session data. When non-null, `storage` will only store a JSON object containing the access and refresh token and some adjacent metadata, while `userStorage` will only contain the user object under the key `storageKey + '-user'`.
65
+ *
66
+ * When this option is set and cookie storage is used, `getSession()` and other functions that load a session from the cookie store might not return back a user. It's very important to always use `getUser()` to fetch a user object in those scenarios.
67
+ *
68
+ * @experimental
69
+ */
70
+ userStorage?: SupportedStorage;
71
+ fetch?: Fetch;
72
+ flowType?: AuthFlowType;
73
+ debug?: boolean | ((message: string, ...args: any[]) => void);
74
+ /**
75
+ * Provide your own locking mechanism based on the environment. By default,
76
+ * `navigatorLock` (Web Locks API) is used in browser environments when
77
+ * `persistSession` is true. Falls back to an in-process lock for non-browser
78
+ * environments (e.g. React Native).
79
+ *
80
+ * @experimental
81
+ */
82
+ lock?: LockFunc;
83
+ /**
84
+ * Set to "true" if there is a custom authorization header set globally.
85
+ * @experimental
86
+ */
87
+ hasCustomAuthorizationHeader?: boolean;
88
+ /**
89
+ * If there is an error with the query, throwOnError will reject the promise by
90
+ * throwing the error instead of returning it as part of a successful response.
91
+ */
92
+ throwOnError?: boolean;
93
+ /**
94
+ * The maximum time in milliseconds to wait for acquiring a cross-tab synchronization lock.
95
+ *
96
+ * When multiple browser tabs or windows use the auth client simultaneously, they coordinate
97
+ * via the Web Locks API to prevent race conditions during session refresh and other operations.
98
+ * This timeout controls how long to wait before attempting lock recovery.
99
+ *
100
+ * - **Positive value**: Wait up to this many milliseconds. If the lock is still held, attempt
101
+ * automatic recovery by stealing it (the previous holder is evicted, its callback continues
102
+ * to completion without exclusive access). This recovers from orphaned locks caused by
103
+ * React Strict Mode double-mount, storage API hangs, or aborted operations.
104
+ * - **Zero (0)**: Fail immediately if the lock is unavailable; throws `LockAcquireTimeoutError`
105
+ * (check `error.isAcquireTimeout === true`).
106
+ * - **Negative value**: Wait indefinitely — can cause permanent deadlocks if the lock is orphaned.
107
+ *
108
+ * @default 5000
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * const client = createClient(url, key, {
113
+ * auth: {
114
+ * lockAcquireTimeout: 5000, // 5 seconds, then steal orphaned lock
115
+ * },
116
+ * })
117
+ * ```
118
+ */
119
+ lockAcquireTimeout?: number;
120
+ /**
121
+ * If true, skips automatic initialization in constructor. Useful for SSR
122
+ * contexts where initialization timing must be controlled to prevent race
123
+ * conditions with HTTP response generation.
124
+ *
125
+ * @default false
126
+ */
127
+ skipAutoInitialize?: boolean;
128
+ };
129
+ declare const WeakPasswordReasons: readonly ["length", "characters", "pwned"];
130
+ export type WeakPasswordReasons = (typeof WeakPasswordReasons)[number];
131
+ export type WeakPassword = {
132
+ reasons: WeakPasswordReasons[];
133
+ message: string;
134
+ };
135
+ /**
136
+ * Resolve mapped types and show the derived keys and their types when hovering in
137
+ * VS Code, instead of just showing the names those mapped types are defined with.
138
+ */
139
+ export type Prettify<T> = T extends Function ? T : {
140
+ [K in keyof T]: T[K];
141
+ };
142
+ /**
143
+ * A stricter version of TypeScript's Omit that only allows omitting keys that actually exist.
144
+ * This prevents typos and ensures type safety at compile time.
145
+ * Unlike regular Omit, this will error if you try to omit a non-existent key.
146
+ */
147
+ export type StrictOmit<T, K extends keyof T> = Omit<T, K>;
148
+ /**
149
+ * a shared result type that encapsulates errors instead of throwing them, allows you to optionally specify the ErrorType
150
+ */
151
+ export type RequestResult<T, ErrorType extends Error = AuthError> = {
152
+ data: T;
153
+ error: null;
154
+ } | {
155
+ data: null;
156
+ error: Error extends AuthError ? AuthError : ErrorType;
157
+ };
158
+ /**
159
+ * similar to RequestResult except it allows you to destructure the possible shape of the success response
160
+ * {@see RequestResult}
161
+ */
162
+ export type RequestResultSafeDestructure<T> = {
163
+ data: T;
164
+ error: null;
165
+ } | {
166
+ data: T extends object ? {
167
+ [K in keyof T]: null;
168
+ } : null;
169
+ error: AuthError;
170
+ };
171
+ export type AuthResponse = RequestResultSafeDestructure<{
172
+ user: User | null;
173
+ session: Session | null;
174
+ }>;
175
+ export type AuthResponsePassword = RequestResultSafeDestructure<{
176
+ user: User | null;
177
+ session: Session | null;
178
+ weak_password?: WeakPassword | null;
179
+ }>;
180
+ /**
181
+ * AuthOtpResponse is returned when OTP is used.
182
+ *
183
+ * {@see AuthResponse}
184
+ */
185
+ export type AuthOtpResponse = RequestResultSafeDestructure<{
186
+ user: null;
187
+ session: null;
188
+ messageId?: string | null;
189
+ }>;
190
+ export type AuthTokenResponse = RequestResultSafeDestructure<{
191
+ user: User;
192
+ session: Session;
193
+ }>;
194
+ export type AuthTokenResponsePassword = RequestResultSafeDestructure<{
195
+ user: User;
196
+ session: Session;
197
+ weakPassword?: WeakPassword;
198
+ }>;
199
+ export type OAuthResponse = {
200
+ data: {
201
+ provider: Provider;
202
+ url: string;
203
+ };
204
+ error: null;
205
+ } | {
206
+ data: {
207
+ provider: Provider;
208
+ url: null;
209
+ };
210
+ error: AuthError;
211
+ };
212
+ export type SSOResponse = RequestResult<{
213
+ /**
214
+ * URL to open in a browser which will complete the sign-in flow by
215
+ * taking the user to the identity provider's authentication flow.
216
+ *
217
+ * On browsers you can set the URL to `window.location.href` to take
218
+ * the user to the authentication flow.
219
+ */
220
+ url: string;
221
+ }>;
222
+ export type UserResponse = RequestResultSafeDestructure<{
223
+ user: User;
224
+ }>;
225
+ export interface Session {
226
+ /**
227
+ * The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.
228
+ */
229
+ provider_token?: string | null;
230
+ /**
231
+ * The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.
232
+ * Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.
233
+ */
234
+ provider_refresh_token?: string | null;
235
+ /**
236
+ * The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.
237
+ */
238
+ access_token: string;
239
+ /**
240
+ * A one-time used refresh token that never expires.
241
+ */
242
+ refresh_token: string;
243
+ /**
244
+ * The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.
245
+ */
246
+ expires_in: number;
247
+ /**
248
+ * A timestamp of when the token will expire. Returned when a login is confirmed.
249
+ */
250
+ expires_at?: number;
251
+ token_type: 'bearer';
252
+ /**
253
+ * When using a separate user storage, accessing properties of this object will throw an error.
254
+ */
255
+ user: User;
256
+ }
257
+ declare const AMRMethods: readonly ["password", "otp", "oauth", "totp", "mfa/totp", "mfa/phone", "mfa/webauthn", "anonymous", "sso/saml", "magiclink", "web3", "oauth_provider/authorization_code"];
258
+ export type AMRMethod = (typeof AMRMethods)[number] | (string & {});
259
+ /**
260
+ * An authentication method reference (AMR) entry.
261
+ *
262
+ * An entry designates what method was used by the user to verify their
263
+ * identity and at what time.
264
+ *
265
+ * Note: Custom access token hooks can return AMR claims as either:
266
+ * - An array of AMREntry objects (detailed format with timestamps)
267
+ * - An array of strings (RFC-8176 compliant format)
268
+ *
269
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}.
270
+ */
271
+ export interface AMREntry {
272
+ /** Authentication method name. */
273
+ method: AMRMethod;
274
+ /**
275
+ * Timestamp when the method was successfully used. Represents number of
276
+ * seconds since 1st January 1970 (UNIX epoch) in UTC.
277
+ */
278
+ timestamp: number;
279
+ }
280
+ export interface UserIdentity {
281
+ id: string;
282
+ user_id: string;
283
+ identity_data?: {
284
+ [key: string]: any;
285
+ };
286
+ identity_id: string;
287
+ provider: string;
288
+ created_at?: string;
289
+ last_sign_in_at?: string;
290
+ updated_at?: string;
291
+ }
292
+ declare const FactorTypes: readonly ["totp", "phone", "webauthn"];
293
+ /**
294
+ * Type of factor. `totp` and `phone` supported with this version
295
+ */
296
+ export type FactorType = (typeof FactorTypes)[number];
297
+ declare const FactorVerificationStatuses: readonly ["verified", "unverified"];
298
+ /**
299
+ * The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`
300
+ */
301
+ type FactorVerificationStatus = (typeof FactorVerificationStatuses)[number];
302
+ /**
303
+ * A MFA factor.
304
+ *
305
+ * @see {@link GoTrueMFAApi#enroll}
306
+ * @see {@link GoTrueMFAApi#listFactors}
307
+ * @see {@link GoTrueMFAAdminApi#listFactors}
308
+ */
309
+ export type Factor<Type extends FactorType = FactorType, Status extends FactorVerificationStatus = (typeof FactorVerificationStatuses)[number]> = {
310
+ /** ID of the factor. */
311
+ id: string;
312
+ /** Friendly name of the factor, useful to disambiguate between multiple factors. */
313
+ friendly_name?: string;
314
+ /**
315
+ * Type of factor. `totp` and `phone` supported with this version
316
+ */
317
+ factor_type: Type;
318
+ /**
319
+ * The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`
320
+ */
321
+ status: Status;
322
+ created_at: string;
323
+ updated_at: string;
324
+ last_challenged_at?: string;
325
+ };
326
+ export interface UserAppMetadata {
327
+ /**
328
+ * The first provider that the user used to sign up with.
329
+ */
330
+ provider?: string;
331
+ /**
332
+ * A list of all providers that the user has linked to their account.
333
+ */
334
+ providers?: string[];
335
+ [key: string]: any;
336
+ }
337
+ export interface UserMetadata {
338
+ [key: string]: any;
339
+ }
340
+ export interface User {
341
+ id: string;
342
+ app_metadata: UserAppMetadata;
343
+ user_metadata: UserMetadata;
344
+ aud: string;
345
+ confirmation_sent_at?: string;
346
+ recovery_sent_at?: string;
347
+ email_change_sent_at?: string;
348
+ new_email?: string;
349
+ new_phone?: string;
350
+ invited_at?: string;
351
+ action_link?: string;
352
+ email?: string;
353
+ phone?: string;
354
+ created_at: string;
355
+ confirmed_at?: string;
356
+ email_confirmed_at?: string;
357
+ phone_confirmed_at?: string;
358
+ last_sign_in_at?: string;
359
+ role?: string;
360
+ updated_at?: string;
361
+ identities?: UserIdentity[];
362
+ is_anonymous?: boolean;
363
+ is_sso_user?: boolean;
364
+ factors?: (Factor<FactorType, 'verified'> | Factor<FactorType, 'unverified'>)[];
365
+ deleted_at?: string;
366
+ banned_until?: string;
367
+ }
368
+ export interface UserAttributes {
369
+ /**
370
+ * The user's current password
371
+ *
372
+ * This is only ever present when the user is resetting
373
+ * their password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true.
374
+ *
375
+ */
376
+ current_password?: string;
377
+ /**
378
+ * The user's email.
379
+ */
380
+ email?: string;
381
+ /**
382
+ * The user's phone.
383
+ */
384
+ phone?: string;
385
+ /**
386
+ * The user's password.
387
+ */
388
+ password?: string;
389
+ /**
390
+ * The nonce sent for reauthentication if the user's password is to be updated.
391
+ *
392
+ * Call reauthenticate() to obtain the nonce first.
393
+ */
394
+ nonce?: string;
395
+ /**
396
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
397
+ *
398
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
399
+ *
400
+ */
401
+ data?: object;
402
+ }
403
+ export interface AdminUserAttributes extends Omit<UserAttributes, 'data'> {
404
+ /**
405
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
406
+ *
407
+ *
408
+ * The `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.
409
+ *
410
+ * Note: When using the GoTrueAdminApi and wanting to modify a user's metadata,
411
+ * this attribute is used instead of UserAttributes data.
412
+ *
413
+ */
414
+ user_metadata?: object;
415
+ /**
416
+ * A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.
417
+ *
418
+ * Only a service role can modify.
419
+ *
420
+ * The `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other
421
+ * access control information.
422
+ */
423
+ app_metadata?: object;
424
+ /**
425
+ * Sets the user's email as confirmed when true, or unconfirmed when false.
426
+ *
427
+ * Only a service role can modify.
428
+ */
429
+ email_confirm?: boolean;
430
+ /**
431
+ * Sets the user's phone as confirmed when true, or unconfirmed when false.
432
+ *
433
+ * Only a service role can modify.
434
+ */
435
+ phone_confirm?: boolean;
436
+ /**
437
+ * Determines how long a user is banned for.
438
+ *
439
+ * The format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.
440
+ * Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
441
+ *
442
+ * For example, some possible durations include: '300ms', '2h45m'.
443
+ *
444
+ * Setting the ban duration to 'none' lifts the ban on the user.
445
+ */
446
+ ban_duration?: string | 'none';
447
+ /**
448
+ * The `role` claim set in the user's access token JWT.
449
+ *
450
+ * When a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.
451
+ *
452
+ * Setting this role to `service_role` is not recommended as it grants the user admin privileges.
453
+ */
454
+ role?: string;
455
+ /**
456
+ * The `password_hash` for the user's password.
457
+ *
458
+ * Allows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.
459
+ *
460
+ * Supports bcrypt, scrypt (firebase), and argon2 password hashes.
461
+ */
462
+ password_hash?: string;
463
+ /**
464
+ * The `id` for the user.
465
+ *
466
+ * Allows you to overwrite the default `id` set for the user.
467
+ */
468
+ id?: string;
469
+ }
470
+ export interface Subscription {
471
+ /**
472
+ * A unique identifier for this subscription, set by the client.
473
+ * This is an internal identifier used for managing callbacks and should not be
474
+ * relied upon by application code. Use the unsubscribe() method to remove listeners.
475
+ */
476
+ id: string | symbol;
477
+ /**
478
+ * The function to call every time there is an event. eg: (eventName) => {}
479
+ */
480
+ callback: (event: AuthChangeEvent, session: Session | null) => void;
481
+ /**
482
+ * Call this to remove the listener.
483
+ */
484
+ unsubscribe: () => void;
485
+ }
486
+ export type SignInAnonymouslyCredentials = {
487
+ options?: {
488
+ /**
489
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
490
+ *
491
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
492
+ */
493
+ data?: object;
494
+ /** Verification token received when the user completes the captcha on the site. */
495
+ captchaToken?: string;
496
+ };
497
+ };
498
+ export type SignUpWithPasswordCredentials = Prettify<PasswordCredentialsBase & {
499
+ options?: {
500
+ emailRedirectTo?: string;
501
+ data?: object;
502
+ captchaToken?: string;
503
+ channel?: 'sms' | 'whatsapp';
504
+ };
505
+ }>;
506
+ type PasswordCredentialsBase = {
507
+ email: string;
508
+ password: string;
509
+ } | {
510
+ phone: string;
511
+ password: string;
512
+ };
513
+ export type SignInWithPasswordCredentials = PasswordCredentialsBase & {
514
+ options?: {
515
+ captchaToken?: string;
516
+ };
517
+ };
518
+ export type SignInWithPasswordlessCredentials = {
519
+ /** The user's email address. */
520
+ email: string;
521
+ options?: {
522
+ /** The redirect url embedded in the email link */
523
+ emailRedirectTo?: string;
524
+ /** If set to false, this method will not create a new user. Defaults to true. */
525
+ shouldCreateUser?: boolean;
526
+ /**
527
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
528
+ *
529
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
530
+ */
531
+ data?: object;
532
+ /** Verification token received when the user completes the captcha on the site. */
533
+ captchaToken?: string;
534
+ };
535
+ } | {
536
+ /** The user's phone number. */
537
+ phone: string;
538
+ options?: {
539
+ /** If set to false, this method will not create a new user. Defaults to true. */
540
+ shouldCreateUser?: boolean;
541
+ /**
542
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
543
+ *
544
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
545
+ */
546
+ data?: object;
547
+ /** Verification token received when the user completes the captcha on the site. */
548
+ captchaToken?: string;
549
+ /** Messaging channel to use (e.g. whatsapp or sms) */
550
+ channel?: 'sms' | 'whatsapp';
551
+ };
552
+ };
553
+ export type AuthFlowType = 'implicit' | 'pkce';
554
+ export type SignInWithOAuthCredentials = {
555
+ /** One of the providers supported by GoTrue. */
556
+ provider: Provider;
557
+ options?: {
558
+ /** A URL to send the user to after they are confirmed. */
559
+ redirectTo?: string;
560
+ /** A space-separated list of scopes granted to the OAuth application. */
561
+ scopes?: string;
562
+ /** An object of query params */
563
+ queryParams?: {
564
+ [key: string]: string;
565
+ };
566
+ /** If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider. */
567
+ skipBrowserRedirect?: boolean;
568
+ };
569
+ };
570
+ export type SignInWithIdTokenCredentials = {
571
+ /** Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`). */
572
+ provider: 'google' | 'apple' | 'azure' | 'facebook' | 'kakao' | `custom:${string}` | (string & {});
573
+ /** OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token. */
574
+ token: string;
575
+ /** If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token. */
576
+ access_token?: string;
577
+ /** If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token. */
578
+ nonce?: string;
579
+ options?: {
580
+ /** Verification token received when the user completes the captcha on the site. */
581
+ captchaToken?: string;
582
+ };
583
+ };
584
+ export type SolanaWallet = {
585
+ signIn?: (...inputs: SolanaSignInInput[]) => Promise<SolanaSignInOutput | SolanaSignInOutput[]>;
586
+ publicKey?: {
587
+ toBase58: () => string;
588
+ } | null;
589
+ signMessage?: (message: Uint8Array, encoding?: 'utf8' | string) => Promise<Uint8Array> | undefined;
590
+ };
591
+ export type SolanaWeb3Credentials = {
592
+ chain: 'solana';
593
+ /** Wallet interface to use. If not specified will default to `window.solana`. */
594
+ wallet?: SolanaWallet;
595
+ /** Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!** */
596
+ statement?: string;
597
+ options?: {
598
+ /** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
599
+ url?: string;
600
+ /** Verification token received when the user completes the captcha on the site. */
601
+ captchaToken?: string;
602
+ signInWithSolana?: Partial<Omit<SolanaSignInInput, 'version' | 'chain' | 'domain' | 'uri' | 'statement'>>;
603
+ };
604
+ } | {
605
+ chain: 'solana';
606
+ /** Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`. */
607
+ message: string;
608
+ /** Ed25519 signature of the message. */
609
+ signature: Uint8Array;
610
+ options?: {
611
+ /** Verification token received when the user completes the captcha on the site. */
612
+ captchaToken?: string;
613
+ };
614
+ };
615
+ export type EthereumWallet = EIP1193Provider;
616
+ export type EthereumWeb3Credentials = {
617
+ chain: 'ethereum';
618
+ /** Wallet interface to use. If not specified will default to `window.ethereum`. */
619
+ wallet?: EthereumWallet;
620
+ /** Optional statement to include in the Sign in with Ethereum message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!** */
621
+ statement?: string;
622
+ options?: {
623
+ /** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
624
+ url?: string;
625
+ /** Verification token received when the user completes the captcha on the site. */
626
+ captchaToken?: string;
627
+ signInWithEthereum?: Partial<Omit<EthereumSignInInput, 'version' | 'domain' | 'uri' | 'statement'>>;
628
+ };
629
+ } | {
630
+ chain: 'ethereum';
631
+ /** Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`. */
632
+ message: string;
633
+ /** Ethereum curve (secp256k1) signature of the message. */
634
+ signature: Hex;
635
+ options?: {
636
+ /** Verification token received when the user completes the captcha on the site. */
637
+ captchaToken?: string;
638
+ };
639
+ };
640
+ export type Web3Credentials = SolanaWeb3Credentials | EthereumWeb3Credentials;
641
+ export type VerifyOtpParams = VerifyMobileOtpParams | VerifyEmailOtpParams | VerifyTokenHashParams;
642
+ export interface VerifyMobileOtpParams {
643
+ /** The user's phone number. */
644
+ phone: string;
645
+ /** The otp sent to the user's phone number. */
646
+ token: string;
647
+ /** The user's verification type. */
648
+ type: MobileOtpType;
649
+ options?: {
650
+ /** A URL to send the user to after they are confirmed. */
651
+ redirectTo?: string;
652
+ /**
653
+ * Verification token received when the user completes the captcha on the site.
654
+ *
655
+ * @deprecated
656
+ */
657
+ captchaToken?: string;
658
+ };
659
+ }
660
+ export interface VerifyEmailOtpParams {
661
+ /** The user's email address. */
662
+ email: string;
663
+ /** The otp sent to the user's email address. */
664
+ token: string;
665
+ /** The user's verification type. */
666
+ type: EmailOtpType;
667
+ options?: {
668
+ /** A URL to send the user to after they are confirmed. */
669
+ redirectTo?: string;
670
+ /** Verification token received when the user completes the captcha on the site.
671
+ *
672
+ * @deprecated
673
+ */
674
+ captchaToken?: string;
675
+ };
676
+ }
677
+ export interface VerifyTokenHashParams {
678
+ /** The token hash used in an email link */
679
+ token_hash: string;
680
+ /** The user's verification type. */
681
+ type: EmailOtpType;
682
+ }
683
+ export type MobileOtpType = 'sms' | 'phone_change';
684
+ export type EmailOtpType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change' | 'email';
685
+ export type ResendParams = {
686
+ type: Extract<EmailOtpType, 'signup' | 'email_change'>;
687
+ email: string;
688
+ options?: {
689
+ /** A URL to send the user to after they have signed-in. */
690
+ emailRedirectTo?: string;
691
+ /** Verification token received when the user completes the captcha on the site. */
692
+ captchaToken?: string;
693
+ };
694
+ } | {
695
+ type: Extract<MobileOtpType, 'sms' | 'phone_change'>;
696
+ phone: string;
697
+ options?: {
698
+ /** Verification token received when the user completes the captcha on the site. */
699
+ captchaToken?: string;
700
+ };
701
+ };
702
+ export type SignInWithSSO = {
703
+ /** UUID of the SSO provider to invoke single-sign on to. */
704
+ providerId: string;
705
+ options?: {
706
+ /** A URL to send the user to after they have signed-in. */
707
+ redirectTo?: string;
708
+ /** Verification token received when the user completes the captcha on the site. */
709
+ captchaToken?: string;
710
+ /**
711
+ * If set to true, the redirect will not happen on the client side.
712
+ * This parameter is used when you wish to handle the redirect yourself.
713
+ * Defaults to false.
714
+ */
715
+ skipBrowserRedirect?: boolean;
716
+ };
717
+ } | {
718
+ /** Domain name of the organization for which to invoke single-sign on. */
719
+ domain: string;
720
+ options?: {
721
+ /** A URL to send the user to after they have signed-in. */
722
+ redirectTo?: string;
723
+ /** Verification token received when the user completes the captcha on the site. */
724
+ captchaToken?: string;
725
+ /**
726
+ * If set to true, the redirect will not happen on the client side.
727
+ * This parameter is used when you wish to handle the redirect yourself.
728
+ * Defaults to false.
729
+ */
730
+ skipBrowserRedirect?: boolean;
731
+ };
732
+ };
733
+ export type GenerateSignupLinkParams = {
734
+ type: 'signup';
735
+ email: string;
736
+ password: string;
737
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
738
+ };
739
+ export type GenerateInviteOrMagiclinkParams = {
740
+ type: 'invite' | 'magiclink';
741
+ /** The user's email */
742
+ email: string;
743
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
744
+ };
745
+ export type GenerateRecoveryLinkParams = {
746
+ type: 'recovery';
747
+ /** The user's email */
748
+ email: string;
749
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>;
750
+ };
751
+ export type GenerateEmailChangeLinkParams = {
752
+ type: 'email_change_current' | 'email_change_new';
753
+ /** The user's email */
754
+ email: string;
755
+ /**
756
+ * The user's new email. Only required if type is 'email_change_current' or 'email_change_new'.
757
+ */
758
+ newEmail: string;
759
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>;
760
+ };
761
+ export interface GenerateLinkOptions {
762
+ /**
763
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
764
+ *
765
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
766
+ */
767
+ data?: object;
768
+ /** The URL which will be appended to the email link generated. */
769
+ redirectTo?: string;
770
+ }
771
+ export type GenerateLinkParams = GenerateSignupLinkParams | GenerateInviteOrMagiclinkParams | GenerateRecoveryLinkParams | GenerateEmailChangeLinkParams;
772
+ export type GenerateLinkResponse = RequestResultSafeDestructure<{
773
+ properties: GenerateLinkProperties;
774
+ user: User;
775
+ }>;
776
+ /** The properties related to the email link generated */
777
+ export type GenerateLinkProperties = {
778
+ /**
779
+ * The email link to send to the user.
780
+ * The action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}
781
+ * */
782
+ action_link: string;
783
+ /**
784
+ * The raw email OTP.
785
+ * You should send this in the email if you want your users to verify using an OTP instead of the action link.
786
+ * */
787
+ email_otp: string;
788
+ /**
789
+ * The hashed token appended to the action link.
790
+ * */
791
+ hashed_token: string;
792
+ /** The URL appended to the action link. */
793
+ redirect_to: string;
794
+ /** The verification type that the email link is associated to. */
795
+ verification_type: GenerateLinkType;
796
+ };
797
+ export type GenerateLinkType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change_current' | 'email_change_new';
798
+ export type MFAEnrollParams = MFAEnrollTOTPParams | MFAEnrollPhoneParams | MFAEnrollWebauthnParams;
799
+ export type MFAUnenrollParams = {
800
+ /** ID of the factor being unenrolled. */
801
+ factorId: string;
802
+ };
803
+ type MFAVerifyParamsBase = {
804
+ /** ID of the factor being verified. Returned in enroll(). */
805
+ factorId: string;
806
+ /** ID of the challenge being verified. Returned in challenge(). */
807
+ challengeId: string;
808
+ };
809
+ type MFAVerifyTOTPParamFields = {
810
+ /** Verification code provided by the user. */
811
+ code: string;
812
+ };
813
+ export type MFAVerifyTOTPParams = Prettify<MFAVerifyParamsBase & MFAVerifyTOTPParamFields>;
814
+ type MFAVerifyPhoneParamFields = MFAVerifyTOTPParamFields;
815
+ export type MFAVerifyPhoneParams = Prettify<MFAVerifyParamsBase & MFAVerifyPhoneParamFields>;
816
+ type MFAVerifyWebauthnParamFieldsBase = {
817
+ /** Relying party ID */
818
+ rpId: string;
819
+ /** Relying party origins */
820
+ rpOrigins?: string[];
821
+ };
822
+ type MFAVerifyWebauthnCredentialParamFields<T extends 'create' | 'request' = 'create' | 'request'> = {
823
+ /** Operation type */
824
+ type: T;
825
+ /** Creation response from the authenticator (for enrollment/unverified factors) */
826
+ credential_response: T extends 'create' ? RegistrationCredential : AuthenticationCredential;
827
+ };
828
+ /**
829
+ * WebAuthn-specific fields for MFA verification.
830
+ * Supports both credential creation (registration) and request (authentication) flows.
831
+ * @template T - Type of WebAuthn operation: 'create' for registration, 'request' for authentication
832
+ */
833
+ export type MFAVerifyWebauthnParamFields<T extends 'create' | 'request' = 'create' | 'request'> = {
834
+ webauthn: MFAVerifyWebauthnParamFieldsBase & MFAVerifyWebauthnCredentialParamFields<T>;
835
+ };
836
+ /**
837
+ * Parameters for WebAuthn MFA verification.
838
+ * Used to verify WebAuthn credentials after challenge.
839
+ * @template T - Type of WebAuthn operation: 'create' for registration, 'request' for authentication
840
+ * @see {@link https://w3c.github.io/webauthn/#sctn-verifying-assertion W3C WebAuthn Spec - Verifying an Authentication Assertion}
841
+ */
842
+ export type MFAVerifyWebauthnParams<T extends 'create' | 'request' = 'create' | 'request'> = Prettify<MFAVerifyParamsBase & MFAVerifyWebauthnParamFields<T>>;
843
+ export type MFAVerifyParams = MFAVerifyTOTPParams | MFAVerifyPhoneParams | MFAVerifyWebauthnParams;
844
+ type MFAChallengeParamsBase = {
845
+ /** ID of the factor to be challenged. Returned in enroll(). */
846
+ factorId: string;
847
+ };
848
+ declare const MFATOTPChannels: readonly ["sms", "whatsapp"];
849
+ export type MFATOTPChannel = (typeof MFATOTPChannels)[number];
850
+ export type MFAChallengeTOTPParams = Prettify<MFAChallengeParamsBase>;
851
+ type MFAChallengePhoneParamFields<Channel extends MFATOTPChannel = MFATOTPChannel> = {
852
+ /** Messaging channel to use (e.g. whatsapp or sms). Only relevant for phone factors */
853
+ channel: Channel;
854
+ };
855
+ export type MFAChallengePhoneParams = Prettify<MFAChallengeParamsBase & MFAChallengePhoneParamFields>;
856
+ /** WebAuthn parameters for WebAuthn factor challenge */
857
+ type MFAChallengeWebauthnParamFields = {
858
+ webauthn: {
859
+ /** Relying party ID */
860
+ rpId: string;
861
+ /** Relying party origins*/
862
+ rpOrigins?: string[];
863
+ };
864
+ };
865
+ /**
866
+ * Parameters for initiating a WebAuthn MFA challenge.
867
+ * Includes Relying Party information needed for WebAuthn ceremonies.
868
+ * @see {@link https://w3c.github.io/webauthn/#sctn-rp-operations W3C WebAuthn Spec - Relying Party Operations}
869
+ */
870
+ export type MFAChallengeWebauthnParams = Prettify<MFAChallengeParamsBase & MFAChallengeWebauthnParamFields>;
871
+ export type MFAChallengeParams = MFAChallengeTOTPParams | MFAChallengePhoneParams | MFAChallengeWebauthnParams;
872
+ type MFAChallengeAndVerifyParamsBase = Omit<MFAVerifyParamsBase, 'challengeId'>;
873
+ type MFAChallengeAndVerifyTOTPParamFields = MFAVerifyTOTPParamFields;
874
+ type MFAChallengeAndVerifyTOTPParams = Prettify<MFAChallengeAndVerifyParamsBase & MFAChallengeAndVerifyTOTPParamFields>;
875
+ export type MFAChallengeAndVerifyParams = MFAChallengeAndVerifyTOTPParams;
876
+ /**
877
+ * Data returned after successful MFA verification.
878
+ * Contains new session tokens and updated user information.
879
+ */
880
+ export type AuthMFAVerifyResponseData = {
881
+ /** New access token (JWT) after successful verification. */
882
+ access_token: string;
883
+ /** Type of token, always `bearer`. */
884
+ token_type: 'bearer';
885
+ /** Number of seconds in which the access token will expire. */
886
+ expires_in: number;
887
+ /** Refresh token you can use to obtain new access tokens when expired. */
888
+ refresh_token: string;
889
+ /** Updated user profile. */
890
+ user: User;
891
+ };
892
+ /**
893
+ * Response type for MFA verification operations.
894
+ * Returns session tokens on successful verification.
895
+ */
896
+ export type AuthMFAVerifyResponse = RequestResult<AuthMFAVerifyResponseData>;
897
+ export type AuthMFAEnrollResponse = AuthMFAEnrollTOTPResponse | AuthMFAEnrollPhoneResponse | AuthMFAEnrollWebauthnResponse;
898
+ export type AuthMFAUnenrollResponse = RequestResult<{
899
+ /** ID of the factor that was successfully unenrolled. */
900
+ id: string;
901
+ }>;
902
+ type AuthMFAChallengeResponseBase<T extends FactorType> = {
903
+ /** ID of the newly created challenge. */
904
+ id: string;
905
+ /** Factor Type which generated the challenge */
906
+ type: T;
907
+ /** Timestamp in UNIX seconds when this challenge will no longer be usable. */
908
+ expires_at: number;
909
+ };
910
+ type AuthMFAChallengeTOTPResponseFields = {};
911
+ export type AuthMFAChallengeTOTPResponse = RequestResult<Prettify<AuthMFAChallengeResponseBase<'totp'> & AuthMFAChallengeTOTPResponseFields>>;
912
+ type AuthMFAChallengePhoneResponseFields = {};
913
+ export type AuthMFAChallengePhoneResponse = RequestResult<Prettify<AuthMFAChallengeResponseBase<'phone'> & AuthMFAChallengePhoneResponseFields>>;
914
+ type AuthMFAChallengeWebauthnResponseFields = {
915
+ webauthn: {
916
+ type: 'create';
917
+ credential_options: {
918
+ publicKey: PublicKeyCredentialCreationOptionsFuture;
919
+ };
920
+ } | {
921
+ type: 'request';
922
+ credential_options: {
923
+ publicKey: PublicKeyCredentialRequestOptionsFuture;
924
+ };
925
+ };
926
+ };
927
+ /**
928
+ * Response type for WebAuthn MFA challenge.
929
+ * Contains credential creation or request options from the server.
930
+ * @see {@link https://w3c.github.io/webauthn/#sctn-credential-creation W3C WebAuthn Spec - Credential Creation}
931
+ */
932
+ export type AuthMFAChallengeWebauthnResponse = RequestResult<Prettify<AuthMFAChallengeResponseBase<'webauthn'> & AuthMFAChallengeWebauthnResponseFields>>;
933
+ type AuthMFAChallengeWebauthnResponseFieldsJSON = {
934
+ webauthn: {
935
+ type: 'create';
936
+ credential_options: {
937
+ publicKey: ServerCredentialCreationOptions;
938
+ };
939
+ } | {
940
+ type: 'request';
941
+ credential_options: {
942
+ publicKey: ServerCredentialRequestOptions;
943
+ };
944
+ };
945
+ };
946
+ /**
947
+ * JSON-serializable version of WebAuthn challenge response.
948
+ * Used for server communication with base64url-encoded binary fields.
949
+ */
950
+ export type AuthMFAChallengeWebauthnResponseDataJSON = Prettify<AuthMFAChallengeResponseBase<'webauthn'> & AuthMFAChallengeWebauthnResponseFieldsJSON>;
951
+ /**
952
+ * Server response type for WebAuthn MFA challenge.
953
+ * Contains JSON-formatted WebAuthn options ready for browser API.
954
+ */
955
+ export type AuthMFAChallengeWebauthnServerResponse = RequestResult<AuthMFAChallengeWebauthnResponseDataJSON>;
956
+ export type AuthMFAChallengeResponse = AuthMFAChallengeTOTPResponse | AuthMFAChallengePhoneResponse | AuthMFAChallengeWebauthnResponse;
957
+ /** response of ListFactors, which should contain all the types of factors that are available, this ensures we always include all */
958
+ export type AuthMFAListFactorsResponse<T extends typeof FactorTypes = typeof FactorTypes> = RequestResult<{
959
+ /** All available factors (verified and unverified). */
960
+ all: Prettify<Factor>[];
961
+ } & {
962
+ [K in T[number]]: Prettify<Factor<K, 'verified'>>[];
963
+ }>;
964
+ export type AuthenticatorAssuranceLevels = 'aal1' | 'aal2';
965
+ export type AuthMFAGetAuthenticatorAssuranceLevelResponse = RequestResult<{
966
+ /** Current AAL level of the session. */
967
+ currentLevel: AuthenticatorAssuranceLevels | null;
968
+ /**
969
+ * Next possible AAL level for the session. If the next level is higher
970
+ * than the current one, the user should go through MFA.
971
+ *
972
+ * @see {@link GoTrueMFAApi#challenge}
973
+ */
974
+ nextLevel: AuthenticatorAssuranceLevels | null;
975
+ /**
976
+ * A list of all authentication methods attached to this session. Use
977
+ * the information here to detect the last time a user verified a
978
+ * factor, for example if implementing a step-up scenario.
979
+ *
980
+ * Supports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).
981
+ * - String format: ['password', 'otp'] - RFC-8176 compliant
982
+ * - Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps
983
+ */
984
+ currentAuthenticationMethods: AMREntry[] | string[];
985
+ }>;
986
+ /**
987
+ * Contains the full multi-factor authentication API.
988
+ *
989
+ */
990
+ export interface GoTrueMFAApi {
991
+ /**
992
+ * Starts the enrollment process for a new Multi-Factor Authentication (MFA)
993
+ * factor. This method creates a new `unverified` factor.
994
+ * To verify a factor, present the QR code or secret to the user and ask them to add it to their
995
+ * authenticator app.
996
+ * The user has to enter the code from their authenticator app to verify it.
997
+ *
998
+ * Upon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.
999
+ */
1000
+ enroll(params: MFAEnrollTOTPParams): Promise<AuthMFAEnrollTOTPResponse>;
1001
+ enroll(params: MFAEnrollPhoneParams): Promise<AuthMFAEnrollPhoneResponse>;
1002
+ enroll(params: MFAEnrollWebauthnParams): Promise<AuthMFAEnrollWebauthnResponse>;
1003
+ enroll(params: MFAEnrollParams): Promise<AuthMFAEnrollResponse>;
1004
+ /**
1005
+ * Prepares a challenge used to verify that a user has access to a MFA
1006
+ * factor.
1007
+ */
1008
+ challenge(params: MFAChallengeTOTPParams): Promise<Prettify<AuthMFAChallengeTOTPResponse>>;
1009
+ challenge(params: MFAChallengePhoneParams): Promise<Prettify<AuthMFAChallengePhoneResponse>>;
1010
+ challenge(params: MFAChallengeWebauthnParams): Promise<Prettify<AuthMFAChallengeWebauthnResponse>>;
1011
+ challenge(params: MFAChallengeParams): Promise<AuthMFAChallengeResponse>;
1012
+ /**
1013
+ * Verifies a code against a challenge. The verification code is
1014
+ * provided by the user by entering a code seen in their authenticator app.
1015
+ */
1016
+ verify(params: MFAVerifyTOTPParams): Promise<AuthMFAVerifyResponse>;
1017
+ verify(params: MFAVerifyPhoneParams): Promise<AuthMFAVerifyResponse>;
1018
+ verify(params: MFAVerifyWebauthnParams): Promise<AuthMFAVerifyResponse>;
1019
+ verify(params: MFAVerifyParams): Promise<AuthMFAVerifyResponse>;
1020
+ /**
1021
+ * Unenroll removes a MFA factor.
1022
+ * A user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.
1023
+ */
1024
+ unenroll(params: MFAUnenrollParams): Promise<AuthMFAUnenrollResponse>;
1025
+ /**
1026
+ * Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is
1027
+ * provided by the user by entering a code seen in their authenticator app.
1028
+ */
1029
+ challengeAndVerify(params: MFAChallengeAndVerifyParams): Promise<AuthMFAVerifyResponse>;
1030
+ /**
1031
+ * Returns the list of MFA factors enabled for this user.
1032
+ *
1033
+ * @see {@link GoTrueMFAApi#enroll}
1034
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}
1035
+ * @see {@link GoTrueClient#getUser}
1036
+ *
1037
+ */
1038
+ listFactors(): Promise<AuthMFAListFactorsResponse>;
1039
+ /**
1040
+ * Returns the Authenticator Assurance Level (AAL) for the active session.
1041
+ *
1042
+ * - `aal1` (or `null`) means that the user's identity has been verified only
1043
+ * with a conventional login (email+password, OTP, magic link, social login,
1044
+ * etc.).
1045
+ * - `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.
1046
+ *
1047
+ * When called without a JWT parameter, this method is fairly quick (microseconds)
1048
+ * and rarely uses the network. When a JWT is provided (useful in server-side
1049
+ * environments like Edge Functions where no session is stored), this method
1050
+ * will make a network request to validate the user and fetch their MFA factors.
1051
+ *
1052
+ * @param jwt Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used.
1053
+ */
1054
+ getAuthenticatorAssuranceLevel(jwt?: string): Promise<AuthMFAGetAuthenticatorAssuranceLevelResponse>;
1055
+ webauthn: WebAuthnApi;
1056
+ }
1057
+ /**
1058
+ * @expermental
1059
+ */
1060
+ export type AuthMFAAdminDeleteFactorResponse = RequestResult<{
1061
+ /** ID of the factor that was successfully deleted. */
1062
+ id: string;
1063
+ }>;
1064
+ /**
1065
+ * @expermental
1066
+ */
1067
+ export type AuthMFAAdminDeleteFactorParams = {
1068
+ /** ID of the MFA factor to delete. */
1069
+ id: string;
1070
+ /** ID of the user whose factor is being deleted. */
1071
+ userId: string;
1072
+ };
1073
+ /**
1074
+ * @expermental
1075
+ */
1076
+ export type AuthMFAAdminListFactorsResponse = RequestResult<{
1077
+ /** All factors attached to the user. */
1078
+ factors: Factor[];
1079
+ }>;
1080
+ /**
1081
+ * @expermental
1082
+ */
1083
+ export type AuthMFAAdminListFactorsParams = {
1084
+ /** ID of the user. */
1085
+ userId: string;
1086
+ };
1087
+ /**
1088
+ * Contains the full multi-factor authentication administration API.
1089
+ *
1090
+ * @expermental
1091
+ */
1092
+ export interface GoTrueAdminMFAApi {
1093
+ /**
1094
+ * Lists all factors associated to a user.
1095
+ *
1096
+ */
1097
+ listFactors(params: AuthMFAAdminListFactorsParams): Promise<AuthMFAAdminListFactorsResponse>;
1098
+ /**
1099
+ * Deletes a factor on a user. This will log the user out of all active
1100
+ * sessions if the deleted factor was verified.
1101
+ *
1102
+ * @see {@link GoTrueMFAApi#unenroll}
1103
+ *
1104
+ * @expermental
1105
+ */
1106
+ deleteFactor(params: AuthMFAAdminDeleteFactorParams): Promise<AuthMFAAdminDeleteFactorResponse>;
1107
+ }
1108
+ type AnyFunction = (...args: any[]) => any;
1109
+ type MaybePromisify<T> = T | Promise<T>;
1110
+ type PromisifyMethods<T> = {
1111
+ [K in keyof T]: T[K] extends AnyFunction ? (...args: Parameters<T[K]>) => MaybePromisify<ReturnType<T[K]>> : T[K];
1112
+ };
1113
+ export type SupportedStorage = PromisifyMethods<Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>> & {
1114
+ /**
1115
+ * If set to `true` signals to the library that the storage medium is used
1116
+ * on a server and the values may not be authentic, such as reading from
1117
+ * request cookies. Implementations should not set this to true if the client
1118
+ * is used on a server that reads storage information from authenticated
1119
+ * sources, such as a secure database or file.
1120
+ */
1121
+ isServer?: boolean;
1122
+ };
1123
+ export type InitializeResult = {
1124
+ error: AuthError | null;
1125
+ };
1126
+ export type CallRefreshTokenResult = RequestResult<Session>;
1127
+ export type Pagination = {
1128
+ [key: string]: any;
1129
+ nextPage: number | null;
1130
+ lastPage: number;
1131
+ total: number;
1132
+ };
1133
+ export type PageParams = {
1134
+ /** The page number */
1135
+ page?: number;
1136
+ /** Number of items returned per page */
1137
+ perPage?: number;
1138
+ };
1139
+ export type SignOut = {
1140
+ /**
1141
+ * Determines which sessions should be
1142
+ * logged out. Global means all
1143
+ * sessions by this account. Local
1144
+ * means only this session. Others
1145
+ * means all other sessions except the
1146
+ * current one. When using others,
1147
+ * there is no sign-out event fired on
1148
+ * the current session!
1149
+ */
1150
+ scope?: 'global' | 'local' | 'others';
1151
+ };
1152
+ type MFAEnrollParamsBase<T extends FactorType> = {
1153
+ /** The type of factor being enrolled. */
1154
+ factorType: T;
1155
+ /** Human readable name assigned to the factor. */
1156
+ friendlyName?: string;
1157
+ };
1158
+ type MFAEnrollTOTPParamFields = {
1159
+ /** Domain which the user is enrolled with. */
1160
+ issuer?: string;
1161
+ };
1162
+ export type MFAEnrollTOTPParams = Prettify<MFAEnrollParamsBase<'totp'> & MFAEnrollTOTPParamFields>;
1163
+ type MFAEnrollPhoneParamFields = {
1164
+ /** Phone number associated with a factor. Number should conform to E.164 format */
1165
+ phone: string;
1166
+ };
1167
+ export type MFAEnrollPhoneParams = Prettify<MFAEnrollParamsBase<'phone'> & MFAEnrollPhoneParamFields>;
1168
+ type MFAEnrollWebauthnFields = {};
1169
+ /**
1170
+ * Parameters for enrolling a WebAuthn factor.
1171
+ * Creates an unverified WebAuthn factor that must be verified with a credential.
1172
+ * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
1173
+ */
1174
+ export type MFAEnrollWebauthnParams = Prettify<MFAEnrollParamsBase<'webauthn'> & MFAEnrollWebauthnFields>;
1175
+ type AuthMFAEnrollResponseBase<T extends FactorType> = {
1176
+ /** ID of the factor that was just enrolled (in an unverified state). */
1177
+ id: string;
1178
+ /** Type of MFA factor.*/
1179
+ type: T;
1180
+ /** Friendly name of the factor, useful for distinguishing between factors **/
1181
+ friendly_name?: string;
1182
+ };
1183
+ type AuthMFAEnrollTOTPResponseFields = {
1184
+ /** TOTP enrollment information. */
1185
+ totp: {
1186
+ /** Contains a QR code encoding the authenticator URI. You can
1187
+ * convert it to a URL by prepending `data:image/svg+xml;utf-8,` to
1188
+ * the value. Avoid logging this value to the console. */
1189
+ qr_code: string;
1190
+ /** The TOTP secret (also encoded in the QR code). Show this secret
1191
+ * in a password-style field to the user, in case they are unable to
1192
+ * scan the QR code. Avoid logging this value to the console. */
1193
+ secret: string;
1194
+ /** The authenticator URI encoded within the QR code, should you need
1195
+ * to use it. Avoid loggin this value to the console. */
1196
+ uri: string;
1197
+ };
1198
+ };
1199
+ export type AuthMFAEnrollTOTPResponse = RequestResult<Prettify<AuthMFAEnrollResponseBase<'totp'> & AuthMFAEnrollTOTPResponseFields>>;
1200
+ type AuthMFAEnrollPhoneResponseFields = {
1201
+ /** Phone number of the MFA factor in E.164 format. Used to send messages */
1202
+ phone: string;
1203
+ };
1204
+ export type AuthMFAEnrollPhoneResponse = RequestResult<Prettify<AuthMFAEnrollResponseBase<'phone'> & AuthMFAEnrollPhoneResponseFields>>;
1205
+ type AuthMFAEnrollWebauthnFields = {};
1206
+ /**
1207
+ * Response type for WebAuthn factor enrollment.
1208
+ * Returns the enrolled factor ID and metadata.
1209
+ * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
1210
+ */
1211
+ export type AuthMFAEnrollWebauthnResponse = RequestResult<Prettify<AuthMFAEnrollResponseBase<'webauthn'> & AuthMFAEnrollWebauthnFields>>;
1212
+ export type JwtHeader = {
1213
+ alg: 'RS256' | 'ES256' | 'HS256';
1214
+ kid: string;
1215
+ typ: string;
1216
+ };
1217
+ export type RequiredClaims = {
1218
+ iss: string;
1219
+ sub: string;
1220
+ aud: string | string[];
1221
+ exp: number;
1222
+ iat: number;
1223
+ role: string;
1224
+ aal: AuthenticatorAssuranceLevels;
1225
+ session_id: string;
1226
+ };
1227
+ /**
1228
+ * JWT Payload containing claims for Supabase authentication tokens.
1229
+ *
1230
+ * Required claims (iss, aud, exp, iat, sub, role, aal, session_id) are inherited from RequiredClaims.
1231
+ * All other claims are optional as they can be customized via Custom Access Token Hooks.
1232
+ *
1233
+ * @see https://supabase.com/docs/guides/auth/jwt-fields
1234
+ */
1235
+ export interface JwtPayload extends RequiredClaims {
1236
+ email?: string;
1237
+ phone?: string;
1238
+ is_anonymous?: boolean;
1239
+ jti?: string;
1240
+ nbf?: number;
1241
+ app_metadata?: UserAppMetadata;
1242
+ user_metadata?: UserMetadata;
1243
+ /**
1244
+ * Authentication Method References.
1245
+ * Supports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).
1246
+ * - String format: ['password', 'otp'] - RFC-8176 compliant
1247
+ * - Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps
1248
+ */
1249
+ amr?: AMREntry[] | string[];
1250
+ ref?: string;
1251
+ [key: string]: any;
1252
+ }
1253
+ export interface JWK {
1254
+ kty: 'RSA' | 'EC' | 'oct';
1255
+ key_ops: string[];
1256
+ alg?: string;
1257
+ kid?: string;
1258
+ [key: string]: any;
1259
+ }
1260
+ export declare const SIGN_OUT_SCOPES: readonly ["global", "local", "others"];
1261
+ export type SignOutScope = (typeof SIGN_OUT_SCOPES)[number];
1262
+ /**
1263
+ * OAuth client grant types supported by the OAuth 2.1 server.
1264
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1265
+ */
1266
+ export type OAuthClientGrantType = 'authorization_code' | 'refresh_token';
1267
+ /**
1268
+ * OAuth client response types supported by the OAuth 2.1 server.
1269
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1270
+ */
1271
+ export type OAuthClientResponseType = 'code';
1272
+ /**
1273
+ * OAuth client type indicating whether the client can keep credentials confidential.
1274
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1275
+ */
1276
+ export type OAuthClientType = 'public' | 'confidential';
1277
+ /**
1278
+ * OAuth client registration type.
1279
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1280
+ */
1281
+ export type OAuthClientRegistrationType = 'dynamic' | 'manual';
1282
+ /**
1283
+ * OAuth client token endpoint authentication method.
1284
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1285
+ */
1286
+ export type OAuthClientTokenEndpointAuthMethod = 'none' | 'client_secret_basic' | 'client_secret_post';
1287
+ /**
1288
+ * OAuth client object returned from the OAuth 2.1 server.
1289
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1290
+ */
1291
+ export type OAuthClient = {
1292
+ /** Unique identifier for the OAuth client */
1293
+ client_id: string;
1294
+ /** Human-readable name of the OAuth client */
1295
+ client_name: string;
1296
+ /** Client secret (only returned on registration and regeneration) */
1297
+ client_secret?: string;
1298
+ /** Type of OAuth client */
1299
+ client_type: OAuthClientType;
1300
+ /** Token endpoint authentication method */
1301
+ token_endpoint_auth_method: OAuthClientTokenEndpointAuthMethod;
1302
+ /** Registration type of the client */
1303
+ registration_type: OAuthClientRegistrationType;
1304
+ /** URI of the OAuth client */
1305
+ client_uri?: string;
1306
+ /** URI of the OAuth client's logo */
1307
+ logo_uri?: string;
1308
+ /** Array of allowed redirect URIs */
1309
+ redirect_uris: string[];
1310
+ /** Array of allowed grant types */
1311
+ grant_types: OAuthClientGrantType[];
1312
+ /** Array of allowed response types */
1313
+ response_types: OAuthClientResponseType[];
1314
+ /** Scope of the OAuth client */
1315
+ scope?: string;
1316
+ /** Timestamp when the client was created */
1317
+ created_at: string;
1318
+ /** Timestamp when the client was last updated */
1319
+ updated_at: string;
1320
+ };
1321
+ /**
1322
+ * Parameters for creating a new OAuth client.
1323
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1324
+ */
1325
+ export type CreateOAuthClientParams = {
1326
+ /** Human-readable name of the OAuth client */
1327
+ client_name: string;
1328
+ /** URI of the OAuth client */
1329
+ client_uri?: string;
1330
+ /** Array of allowed redirect URIs */
1331
+ redirect_uris: string[];
1332
+ /** Array of allowed grant types (optional, defaults to authorization_code and refresh_token) */
1333
+ grant_types?: OAuthClientGrantType[];
1334
+ /** Array of allowed response types (optional, defaults to code) */
1335
+ response_types?: OAuthClientResponseType[];
1336
+ /** Scope of the OAuth client */
1337
+ scope?: string;
1338
+ /** Token endpoint authentication method (defaults to server default if not specified) */
1339
+ token_endpoint_auth_method?: OAuthClientTokenEndpointAuthMethod;
1340
+ };
1341
+ /**
1342
+ * Parameters for updating an existing OAuth client.
1343
+ * All fields are optional. Only provided fields will be updated.
1344
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1345
+ */
1346
+ export type UpdateOAuthClientParams = {
1347
+ /** Human-readable name of the OAuth client */
1348
+ client_name?: string;
1349
+ /** URI of the OAuth client */
1350
+ client_uri?: string;
1351
+ /** URI of the OAuth client's logo */
1352
+ logo_uri?: string;
1353
+ /** Array of allowed redirect URIs */
1354
+ redirect_uris?: string[];
1355
+ /** Array of allowed grant types */
1356
+ grant_types?: OAuthClientGrantType[];
1357
+ /** Token endpoint authentication method */
1358
+ token_endpoint_auth_method?: OAuthClientTokenEndpointAuthMethod;
1359
+ };
1360
+ /**
1361
+ * Response type for OAuth client operations.
1362
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1363
+ */
1364
+ export type OAuthClientResponse = RequestResult<OAuthClient>;
1365
+ /**
1366
+ * Response type for listing OAuth clients.
1367
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1368
+ */
1369
+ export type OAuthClientListResponse = {
1370
+ data: {
1371
+ clients: OAuthClient[];
1372
+ aud: string;
1373
+ } & Pagination;
1374
+ error: null;
1375
+ } | {
1376
+ data: {
1377
+ clients: [];
1378
+ };
1379
+ error: AuthError;
1380
+ };
1381
+ /**
1382
+ * Contains all OAuth client administration methods.
1383
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1384
+ */
1385
+ export interface GoTrueAdminOAuthApi {
1386
+ /**
1387
+ * Lists all OAuth clients with optional pagination.
1388
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1389
+ *
1390
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1391
+ */
1392
+ listClients(params?: PageParams): Promise<OAuthClientListResponse>;
1393
+ /**
1394
+ * Creates a new OAuth client.
1395
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1396
+ *
1397
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1398
+ */
1399
+ createClient(params: CreateOAuthClientParams): Promise<OAuthClientResponse>;
1400
+ /**
1401
+ * Gets details of a specific OAuth client.
1402
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1403
+ *
1404
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1405
+ */
1406
+ getClient(clientId: string): Promise<OAuthClientResponse>;
1407
+ /**
1408
+ * Updates an existing OAuth client.
1409
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1410
+ *
1411
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1412
+ */
1413
+ updateClient(clientId: string, params: UpdateOAuthClientParams): Promise<OAuthClientResponse>;
1414
+ /**
1415
+ * Deletes an OAuth client.
1416
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1417
+ *
1418
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1419
+ */
1420
+ deleteClient(clientId: string): Promise<{
1421
+ data: null;
1422
+ error: AuthError | null;
1423
+ }>;
1424
+ /**
1425
+ * Regenerates the secret for an OAuth client.
1426
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1427
+ *
1428
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1429
+ */
1430
+ regenerateClientSecret(clientId: string): Promise<OAuthClientResponse>;
1431
+ }
1432
+ /**
1433
+ * Type of custom identity provider.
1434
+ */
1435
+ export type CustomProviderType = 'oauth2' | 'oidc';
1436
+ /**
1437
+ * OIDC discovery document fields.
1438
+ * Populated when the server successfully fetches and validates the
1439
+ * provider's OpenID Connect discovery document.
1440
+ */
1441
+ export type OIDCDiscoveryDocument = {
1442
+ /** The issuer identifier */
1443
+ issuer: string;
1444
+ /** URL of the authorization endpoint */
1445
+ authorization_endpoint: string;
1446
+ /** URL of the token endpoint */
1447
+ token_endpoint: string;
1448
+ /** URL of the JSON Web Key Set */
1449
+ jwks_uri: string;
1450
+ /** URL of the userinfo endpoint */
1451
+ userinfo_endpoint?: string;
1452
+ /** URL of the revocation endpoint */
1453
+ revocation_endpoint?: string;
1454
+ /** List of supported scopes */
1455
+ supported_scopes?: string[];
1456
+ /** List of supported response types */
1457
+ supported_response_types?: string[];
1458
+ /** List of supported subject types */
1459
+ supported_subject_types?: string[];
1460
+ /** List of supported ID token signing algorithms */
1461
+ supported_id_token_signing_algs?: string[];
1462
+ };
1463
+ /**
1464
+ * Custom OAuth/OIDC provider object returned from the admin API.
1465
+ */
1466
+ export type CustomOAuthProvider = {
1467
+ /** Unique identifier (UUID) */
1468
+ id: string;
1469
+ /** Provider type */
1470
+ provider_type: CustomProviderType;
1471
+ /** Provider identifier (e.g. `custom:mycompany`) */
1472
+ identifier: string;
1473
+ /** Human-readable name */
1474
+ name: string;
1475
+ /** OAuth client ID */
1476
+ client_id: string;
1477
+ /** Additional client IDs accepted during token validation */
1478
+ acceptable_client_ids?: string[];
1479
+ /** OAuth scopes requested during authorization */
1480
+ scopes?: string[];
1481
+ /** Whether PKCE is enabled */
1482
+ pkce_enabled?: boolean;
1483
+ /** Mapping of provider attributes to Supabase user attributes */
1484
+ attribute_mapping?: Record<string, any>;
1485
+ /** Additional parameters sent with the authorization request */
1486
+ authorization_params?: Record<string, string>;
1487
+ /** Whether the provider is enabled */
1488
+ enabled?: boolean;
1489
+ /** Whether email is optional for this provider */
1490
+ email_optional?: boolean;
1491
+ /** OIDC issuer URL */
1492
+ issuer?: string;
1493
+ /** OIDC discovery URL */
1494
+ discovery_url?: string;
1495
+ /** Whether to skip nonce check (OIDC) */
1496
+ skip_nonce_check?: boolean;
1497
+ /** OAuth2 authorization URL */
1498
+ authorization_url?: string;
1499
+ /** OAuth2 token URL */
1500
+ token_url?: string;
1501
+ /** OAuth2 userinfo URL */
1502
+ userinfo_url?: string;
1503
+ /** JWKS URI for token verification */
1504
+ jwks_uri?: string;
1505
+ /** OIDC discovery document (OIDC providers only) */
1506
+ discovery_document?: OIDCDiscoveryDocument | null;
1507
+ /** Timestamp when the provider was created */
1508
+ created_at: string;
1509
+ /** Timestamp when the provider was last updated */
1510
+ updated_at: string;
1511
+ };
1512
+ /**
1513
+ * Parameters for creating a new custom provider.
1514
+ */
1515
+ export type CreateCustomProviderParams = {
1516
+ /** Provider type */
1517
+ provider_type: CustomProviderType;
1518
+ /** Provider identifier (e.g. `custom:mycompany`) */
1519
+ identifier: string;
1520
+ /** Human-readable name */
1521
+ name: string;
1522
+ /** OAuth client ID */
1523
+ client_id: string;
1524
+ /** OAuth client secret (write-only, not returned in responses) */
1525
+ client_secret: string;
1526
+ /** Additional client IDs accepted during token validation */
1527
+ acceptable_client_ids?: string[];
1528
+ /** OAuth scopes requested during authorization */
1529
+ scopes?: string[];
1530
+ /** Whether PKCE is enabled */
1531
+ pkce_enabled?: boolean;
1532
+ /** Mapping of provider attributes to Supabase user attributes */
1533
+ attribute_mapping?: Record<string, any>;
1534
+ /** Additional parameters sent with the authorization request */
1535
+ authorization_params?: Record<string, string>;
1536
+ /** Whether the provider is enabled */
1537
+ enabled?: boolean;
1538
+ /** Whether email is optional for this provider */
1539
+ email_optional?: boolean;
1540
+ /** OIDC issuer URL */
1541
+ issuer?: string;
1542
+ /** OIDC discovery URL */
1543
+ discovery_url?: string;
1544
+ /** Whether to skip nonce check (OIDC) */
1545
+ skip_nonce_check?: boolean;
1546
+ /** OAuth2 authorization URL */
1547
+ authorization_url?: string;
1548
+ /** OAuth2 token URL */
1549
+ token_url?: string;
1550
+ /** OAuth2 userinfo URL */
1551
+ userinfo_url?: string;
1552
+ /** JWKS URI for token verification */
1553
+ jwks_uri?: string;
1554
+ };
1555
+ /**
1556
+ * Parameters for updating an existing custom provider.
1557
+ * All fields are optional. Only provided fields will be updated.
1558
+ * `provider_type` and `identifier` are immutable and cannot be changed.
1559
+ */
1560
+ export type UpdateCustomProviderParams = {
1561
+ /** Human-readable name */
1562
+ name?: string;
1563
+ /** OAuth client ID */
1564
+ client_id?: string;
1565
+ /** OAuth client secret (write-only, not returned in responses) */
1566
+ client_secret?: string;
1567
+ /** Additional client IDs accepted during token validation */
1568
+ acceptable_client_ids?: string[];
1569
+ /** OAuth scopes requested during authorization */
1570
+ scopes?: string[];
1571
+ /** Whether PKCE is enabled */
1572
+ pkce_enabled?: boolean;
1573
+ /** Mapping of provider attributes to Supabase user attributes */
1574
+ attribute_mapping?: Record<string, any>;
1575
+ /** Additional parameters sent with the authorization request */
1576
+ authorization_params?: Record<string, string>;
1577
+ /** Whether the provider is enabled */
1578
+ enabled?: boolean;
1579
+ /** Whether email is optional for this provider */
1580
+ email_optional?: boolean;
1581
+ /** OIDC issuer URL */
1582
+ issuer?: string;
1583
+ /** OIDC discovery URL */
1584
+ discovery_url?: string;
1585
+ /** Whether to skip nonce check (OIDC) */
1586
+ skip_nonce_check?: boolean;
1587
+ /** OAuth2 authorization URL */
1588
+ authorization_url?: string;
1589
+ /** OAuth2 token URL */
1590
+ token_url?: string;
1591
+ /** OAuth2 userinfo URL */
1592
+ userinfo_url?: string;
1593
+ /** JWKS URI for token verification */
1594
+ jwks_uri?: string;
1595
+ };
1596
+ /**
1597
+ * Parameters for listing custom providers.
1598
+ */
1599
+ export type ListCustomProvidersParams = {
1600
+ /** Filter by provider type */
1601
+ type?: CustomProviderType;
1602
+ };
1603
+ /**
1604
+ * Response type for custom provider operations.
1605
+ */
1606
+ export type CustomProviderResponse = RequestResult<CustomOAuthProvider>;
1607
+ /**
1608
+ * Response type for listing custom providers.
1609
+ */
1610
+ export type CustomProviderListResponse = {
1611
+ data: {
1612
+ providers: CustomOAuthProvider[];
1613
+ };
1614
+ error: null;
1615
+ } | {
1616
+ data: {
1617
+ providers: [];
1618
+ };
1619
+ error: AuthError;
1620
+ };
1621
+ /**
1622
+ * Contains all custom OIDC/OAuth provider administration methods.
1623
+ */
1624
+ export interface GoTrueAdminCustomProvidersApi {
1625
+ /**
1626
+ * Lists all custom providers with optional type filter.
1627
+ *
1628
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1629
+ */
1630
+ listProviders(params?: ListCustomProvidersParams): Promise<CustomProviderListResponse>;
1631
+ /**
1632
+ * Creates a new custom OIDC/OAuth provider.
1633
+ *
1634
+ * For OIDC providers, the server fetches and validates the OpenID Connect discovery document
1635
+ * from the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.
1636
+ * This may return a validation error (`error_code: "validation_failed"`) if the discovery
1637
+ * document is unreachable, not valid JSON, missing required fields, or if the issuer
1638
+ * in the document does not match the expected issuer.
1639
+ *
1640
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1641
+ */
1642
+ createProvider(params: CreateCustomProviderParams): Promise<CustomProviderResponse>;
1643
+ /**
1644
+ * Gets details of a specific custom provider by identifier.
1645
+ *
1646
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1647
+ */
1648
+ getProvider(identifier: string): Promise<CustomProviderResponse>;
1649
+ /**
1650
+ * Updates an existing custom provider.
1651
+ *
1652
+ * When `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and
1653
+ * validates the discovery document before persisting. This may return a validation error
1654
+ * (`error_code: "validation_failed"`) if the discovery document is unreachable, invalid, or
1655
+ * the issuer does not match.
1656
+ *
1657
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1658
+ */
1659
+ updateProvider(identifier: string, params: UpdateCustomProviderParams): Promise<CustomProviderResponse>;
1660
+ /**
1661
+ * Deletes a custom provider.
1662
+ *
1663
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1664
+ */
1665
+ deleteProvider(identifier: string): Promise<{
1666
+ data: null;
1667
+ error: AuthError | null;
1668
+ }>;
1669
+ }
1670
+ /**
1671
+ * OAuth client details in an authorization request.
1672
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1673
+ */
1674
+ export type OAuthAuthorizationClient = {
1675
+ /** Unique identifier for the OAuth client (UUID) */
1676
+ id: string;
1677
+ /** Human-readable name of the OAuth client */
1678
+ name: string;
1679
+ /** URI of the OAuth client's website */
1680
+ uri: string;
1681
+ /** URI of the OAuth client's logo */
1682
+ logo_uri: string;
1683
+ };
1684
+ /**
1685
+ * OAuth authorization details when user needs to provide consent.
1686
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1687
+ *
1688
+ * This response includes all information needed to display a consent page:
1689
+ * client details, user info, requested scopes, and where the user will be redirected.
1690
+ *
1691
+ * Note: `redirect_uri` is the base URI (e.g., "https://app.com/callback") without
1692
+ * query parameters. After consent, you'll receive a complete `redirect_url` with
1693
+ * the authorization code and state parameters appended.
1694
+ */
1695
+ export type OAuthAuthorizationDetails = {
1696
+ /** The authorization ID used to approve or deny the request */
1697
+ authorization_id: string;
1698
+ /** The OAuth client's registered redirect URI (base URI without query parameters) */
1699
+ redirect_uri: string;
1700
+ /** OAuth client requesting authorization */
1701
+ client: OAuthAuthorizationClient;
1702
+ /** User object associated with the authorization */
1703
+ user: {
1704
+ /** User ID (UUID) */
1705
+ id: string;
1706
+ /** User email */
1707
+ email: string;
1708
+ };
1709
+ /** Space-separated list of requested scopes (e.g., "openid profile email") */
1710
+ scope: string;
1711
+ };
1712
+ /**
1713
+ * OAuth redirect response when user has already consented or after consent decision.
1714
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1715
+ *
1716
+ * This response is returned in three scenarios:
1717
+ * 1. User already consented to these scopes (auto-approved)
1718
+ * 2. User just approved the authorization request
1719
+ * 3. User just denied the authorization request
1720
+ *
1721
+ * The `redirect_url` is a complete URL ready for redirecting the user back to the
1722
+ * OAuth client, including authorization code (on success) or error (on denial) in
1723
+ * query parameters, along with the state parameter if one was provided.
1724
+ */
1725
+ export type OAuthRedirect = {
1726
+ /** Complete redirect URL with authorization code and state parameters (e.g., "https://app.com/callback?code=xxx&state=yyy") */
1727
+ redirect_url: string;
1728
+ };
1729
+ /**
1730
+ * Response type for getting OAuth authorization details.
1731
+ * Returns either full authorization details (if consent needed) or redirect URL (if already consented).
1732
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1733
+ *
1734
+ * @example
1735
+ * ```typescript
1736
+ * const { data, error } = await supabase.auth.oauth.getAuthorizationDetails(authorizationId)
1737
+ *
1738
+ * if (error) {
1739
+ * console.error('Error:', error)
1740
+ * } else if ('authorization_id' in data) {
1741
+ * // User needs to provide consent - show consent page
1742
+ * console.log('Client:', data.client.name)
1743
+ * console.log('Scopes:', data.scope)
1744
+ * console.log('Redirect URI:', data.redirect_uri)
1745
+ * } else {
1746
+ * // User already consented - redirect immediately
1747
+ * window.location.href = data.redirect_url
1748
+ * }
1749
+ * ```
1750
+ */
1751
+ export type AuthOAuthAuthorizationDetailsResponse = RequestResult<OAuthAuthorizationDetails | OAuthRedirect>;
1752
+ /**
1753
+ * Response type for OAuth consent decision (approve/deny).
1754
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1755
+ */
1756
+ export type AuthOAuthConsentResponse = RequestResult<OAuthRedirect>;
1757
+ /**
1758
+ * An OAuth grant representing a user's authorization of an OAuth client.
1759
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1760
+ */
1761
+ export type OAuthGrant = {
1762
+ /** OAuth client information */
1763
+ client: OAuthAuthorizationClient;
1764
+ /** Array of scopes granted to this client */
1765
+ scopes: string[];
1766
+ /** Timestamp when the grant was created (ISO 8601 date-time) */
1767
+ granted_at: string;
1768
+ };
1769
+ /**
1770
+ * Response type for listing user's OAuth grants.
1771
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1772
+ */
1773
+ export type AuthOAuthGrantsResponse = RequestResult<OAuthGrant[]>;
1774
+ /**
1775
+ * Response type for revoking an OAuth grant.
1776
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1777
+ */
1778
+ export type AuthOAuthRevokeGrantResponse = RequestResult<{}>;
1779
+ /**
1780
+ * Contains all OAuth 2.1 authorization server user-facing methods.
1781
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1782
+ *
1783
+ * These methods are used to implement the consent page.
1784
+ */
1785
+ export interface AuthOAuthServerApi {
1786
+ /**
1787
+ * Retrieves details about an OAuth authorization request.
1788
+ * Used to display consent information to the user.
1789
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1790
+ *
1791
+ * This method returns one of two response types:
1792
+ * - `OAuthAuthorizationDetails`: User needs to consent - show consent page with client info
1793
+ * - `OAuthRedirect`: User already consented - redirect immediately to the OAuth client
1794
+ *
1795
+ * Use type narrowing to distinguish between the responses:
1796
+ * ```typescript
1797
+ * if ('authorization_id' in data) {
1798
+ * // Show consent page
1799
+ * } else {
1800
+ * // Redirect to data.redirect_url
1801
+ * }
1802
+ * ```
1803
+ *
1804
+ * @param authorizationId - The authorization ID from the authorization request
1805
+ * @returns Authorization details or redirect URL depending on consent status
1806
+ */
1807
+ getAuthorizationDetails(authorizationId: string): Promise<AuthOAuthAuthorizationDetailsResponse>;
1808
+ /**
1809
+ * Approves an OAuth authorization request.
1810
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1811
+ *
1812
+ * After approval, the user's consent is stored and an authorization code is generated.
1813
+ * The response contains a complete redirect URL with the authorization code and state.
1814
+ *
1815
+ * @param authorizationId - The authorization ID to approve
1816
+ * @param options - Optional parameters
1817
+ * @param options.skipBrowserRedirect - If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling).
1818
+ * @returns Redirect URL to send the user back to the OAuth client with authorization code
1819
+ */
1820
+ approveAuthorization(authorizationId: string, options?: {
1821
+ skipBrowserRedirect?: boolean;
1822
+ }): Promise<AuthOAuthConsentResponse>;
1823
+ /**
1824
+ * Denies an OAuth authorization request.
1825
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1826
+ *
1827
+ * After denial, the response contains a redirect URL with an OAuth error
1828
+ * (access_denied) to inform the OAuth client that the user rejected the request.
1829
+ *
1830
+ * @param authorizationId - The authorization ID to deny
1831
+ * @param options - Optional parameters
1832
+ * @param options.skipBrowserRedirect - If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling).
1833
+ * @returns Redirect URL to send the user back to the OAuth client with error information
1834
+ */
1835
+ denyAuthorization(authorizationId: string, options?: {
1836
+ skipBrowserRedirect?: boolean;
1837
+ }): Promise<AuthOAuthConsentResponse>;
1838
+ /**
1839
+ * Lists all OAuth grants that the authenticated user has authorized.
1840
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1841
+ *
1842
+ * @returns Response with array of OAuth grants with client information and granted scopes
1843
+ */
1844
+ listGrants(): Promise<AuthOAuthGrantsResponse>;
1845
+ /**
1846
+ * Revokes a user's OAuth grant for a specific client.
1847
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1848
+ *
1849
+ * Revocation marks consent as revoked, deletes active sessions for that OAuth client,
1850
+ * and invalidates associated refresh tokens.
1851
+ *
1852
+ * @param options - Revocation options
1853
+ * @param options.clientId - The OAuth client identifier (UUID) to revoke access for
1854
+ * @returns Empty response on successful revocation
1855
+ */
1856
+ revokeGrant(options: {
1857
+ clientId: string;
1858
+ }): Promise<AuthOAuthRevokeGrantResponse>;
1859
+ }
1860
+ export {};
1861
+ //# sourceMappingURL=types.d.ts.map