@eventmodelers/node-kit 0.0.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.
Files changed (546) hide show
  1. package/README.md +66 -0
  2. package/package.json +36 -0
  3. package/src/cli.js +176 -0
  4. package/templates/.claude/skills/connect/SKILL.md +169 -0
  5. package/templates/.claude/skills/load-slice/SKILL.md +86 -0
  6. package/templates/realtime-agent/node_modules/.package-lock.json +107 -0
  7. package/templates/realtime-agent/node_modules/@supabase/auth-js/LICENSE +21 -0
  8. package/templates/realtime-agent/node_modules/@supabase/auth-js/README.md +190 -0
  9. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts +4 -0
  10. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts.map +1 -0
  11. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js +7 -0
  12. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js.map +1 -0
  13. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts +4 -0
  14. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts.map +1 -0
  15. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js +7 -0
  16. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js.map +1 -0
  17. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts +716 -0
  18. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts.map +1 -0
  19. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js +1108 -0
  20. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js.map +1 -0
  21. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts +2473 -0
  22. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts.map +1 -0
  23. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js +5217 -0
  24. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js.map +1 -0
  25. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts +9 -0
  26. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts.map +1 -0
  27. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js +20 -0
  28. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js.map +1 -0
  29. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts +76 -0
  30. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts.map +1 -0
  31. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js +269 -0
  32. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js.map +1 -0
  33. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts +26 -0
  34. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts.map +1 -0
  35. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js +31 -0
  36. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js.map +1 -0
  37. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts +7 -0
  38. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts.map +1 -0
  39. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js +3 -0
  40. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js.map +1 -0
  41. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts +258 -0
  42. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts.map +1 -0
  43. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js +290 -0
  44. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js.map +1 -0
  45. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts +54 -0
  46. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts.map +1 -0
  47. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js +200 -0
  48. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js.map +1 -0
  49. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts +94 -0
  50. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts.map +1 -0
  51. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js +406 -0
  52. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js.map +1 -0
  53. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts +9 -0
  54. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts.map +1 -0
  55. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js +21 -0
  56. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js.map +1 -0
  57. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts +107 -0
  58. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts.map +1 -0
  59. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js +349 -0
  60. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js.map +1 -0
  61. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts +5 -0
  62. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts.map +1 -0
  63. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js +29 -0
  64. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js.map +1 -0
  65. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts +2498 -0
  66. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts.map +1 -0
  67. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js +23 -0
  68. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js.map +1 -0
  69. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts +2 -0
  70. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts.map +1 -0
  71. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js +11 -0
  72. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js.map +1 -0
  73. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts +96 -0
  74. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts.map +1 -0
  75. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js +66 -0
  76. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js.map +1 -0
  77. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts +160 -0
  78. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts.map +1 -0
  79. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js +4 -0
  80. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js.map +1 -0
  81. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts +284 -0
  82. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts.map +1 -0
  83. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts +583 -0
  84. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts.map +1 -0
  85. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js +4 -0
  86. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js.map +1 -0
  87. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts +85 -0
  88. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts.map +1 -0
  89. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js +272 -0
  90. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js.map +1 -0
  91. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js +707 -0
  92. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js.map +1 -0
  93. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts +4 -0
  94. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts.map +1 -0
  95. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js +4 -0
  96. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js.map +1 -0
  97. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts +4 -0
  98. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts.map +1 -0
  99. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js +4 -0
  100. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js.map +1 -0
  101. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts +716 -0
  102. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts.map +1 -0
  103. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js +1105 -0
  104. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js.map +1 -0
  105. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts +2473 -0
  106. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts.map +1 -0
  107. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js +5214 -0
  108. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js.map +1 -0
  109. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts +9 -0
  110. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts.map +1 -0
  111. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js +9 -0
  112. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js.map +1 -0
  113. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts +76 -0
  114. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts.map +1 -0
  115. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js +257 -0
  116. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js.map +1 -0
  117. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts +26 -0
  118. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts.map +1 -0
  119. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js +28 -0
  120. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js.map +1 -0
  121. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts +7 -0
  122. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts.map +1 -0
  123. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js +2 -0
  124. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js.map +1 -0
  125. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts +258 -0
  126. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts.map +1 -0
  127. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js +267 -0
  128. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js.map +1 -0
  129. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts +54 -0
  130. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts.map +1 -0
  131. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js +190 -0
  132. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js.map +1 -0
  133. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts +94 -0
  134. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts.map +1 -0
  135. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js +378 -0
  136. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js.map +1 -0
  137. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts +9 -0
  138. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts.map +1 -0
  139. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js +18 -0
  140. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js.map +1 -0
  141. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts +107 -0
  142. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts.map +1 -0
  143. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js +341 -0
  144. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js.map +1 -0
  145. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts +5 -0
  146. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts.map +1 -0
  147. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js +26 -0
  148. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js.map +1 -0
  149. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts +2498 -0
  150. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts.map +1 -0
  151. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js +20 -0
  152. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js.map +1 -0
  153. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts +2 -0
  154. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts.map +1 -0
  155. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js +8 -0
  156. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js.map +1 -0
  157. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts +96 -0
  158. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts.map +1 -0
  159. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js +60 -0
  160. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js.map +1 -0
  161. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts +160 -0
  162. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts.map +1 -0
  163. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js +3 -0
  164. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js.map +1 -0
  165. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts +284 -0
  166. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts.map +1 -0
  167. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts +583 -0
  168. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts.map +1 -0
  169. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js +3 -0
  170. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js.map +1 -0
  171. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts +85 -0
  172. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts.map +1 -0
  173. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js +264 -0
  174. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js.map +1 -0
  175. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js +689 -0
  176. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js.map +1 -0
  177. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.module.tsbuildinfo +1 -0
  178. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.tsbuildinfo +1 -0
  179. package/templates/realtime-agent/node_modules/@supabase/auth-js/package.json +44 -0
  180. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthAdminApi.ts +5 -0
  181. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthClient.ts +5 -0
  182. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueAdminApi.ts +1267 -0
  183. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueClient.ts +6360 -0
  184. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/index.ts +13 -0
  185. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/base64url.ts +308 -0
  186. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/constants.ts +34 -0
  187. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/error-codes.ts +90 -0
  188. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/errors.ts +359 -0
  189. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/fetch.ts +320 -0
  190. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/helpers.ts +476 -0
  191. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/local-storage.ts +21 -0
  192. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/locks.ts +420 -0
  193. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/polyfills.ts +23 -0
  194. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/types.ts +2917 -0
  195. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/version.ts +7 -0
  196. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/ethereum.ts +184 -0
  197. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/solana.ts +186 -0
  198. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.dom.ts +636 -0
  199. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.errors.ts +329 -0
  200. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.ts +946 -0
  201. package/templates/realtime-agent/node_modules/@supabase/functions-js/README.md +134 -0
  202. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts +177 -0
  203. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts.map +1 -0
  204. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js +309 -0
  205. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js.map +1 -0
  206. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts +3 -0
  207. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts.map +1 -0
  208. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js +11 -0
  209. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js.map +1 -0
  210. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts +3 -0
  211. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts.map +1 -0
  212. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js +12 -0
  213. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js.map +1 -0
  214. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts +122 -0
  215. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts.map +1 -0
  216. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js +98 -0
  217. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js.map +1 -0
  218. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts +2 -0
  219. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts.map +1 -0
  220. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js +11 -0
  221. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js.map +1 -0
  222. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts +177 -0
  223. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts.map +1 -0
  224. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js +305 -0
  225. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js.map +1 -0
  226. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts +3 -0
  227. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts.map +1 -0
  228. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js +7 -0
  229. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js.map +1 -0
  230. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts +3 -0
  231. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts.map +1 -0
  232. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js +3 -0
  233. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js.map +1 -0
  234. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts +122 -0
  235. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts.map +1 -0
  236. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js +91 -0
  237. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js.map +1 -0
  238. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts +2 -0
  239. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts.map +1 -0
  240. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js +8 -0
  241. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js.map +1 -0
  242. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.module.tsbuildinfo +1 -0
  243. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.tsbuildinfo +1 -0
  244. package/templates/realtime-agent/node_modules/@supabase/functions-js/package.json +52 -0
  245. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/FunctionsClient.ts +335 -0
  246. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/edge-runtime.d.ts +214 -0
  247. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/helper.ts +8 -0
  248. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/index.ts +10 -0
  249. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/types.ts +146 -0
  250. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/version.ts +7 -0
  251. package/templates/realtime-agent/node_modules/@supabase/phoenix/LICENSE.md +22 -0
  252. package/templates/realtime-agent/node_modules/@supabase/phoenix/README.md +121 -0
  253. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/ajax.js +116 -0
  254. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/channel.js +331 -0
  255. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/constants.js +35 -0
  256. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/index.js +212 -0
  257. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/longpoll.js +192 -0
  258. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/presence.js +208 -0
  259. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/push.js +134 -0
  260. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/serializer.js +133 -0
  261. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/socket.js +756 -0
  262. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/timer.js +48 -0
  263. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/types.js +184 -0
  264. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/utils.js +16 -0
  265. package/templates/realtime-agent/node_modules/@supabase/phoenix/package.json +58 -0
  266. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/favicon.ico +0 -0
  267. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix-orange.png +0 -0
  268. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js +1825 -0
  269. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js.map +7 -0
  270. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.js +1847 -0
  271. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.min.js +2 -0
  272. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs +1802 -0
  273. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs.map +7 -0
  274. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.png +0 -0
  275. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts +10 -0
  276. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts.map +1 -0
  277. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts +167 -0
  278. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts.map +1 -0
  279. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts +36 -0
  280. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts.map +1 -0
  281. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts +10 -0
  282. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts.map +1 -0
  283. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts +29 -0
  284. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts.map +1 -0
  285. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts +107 -0
  286. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts.map +1 -0
  287. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts +70 -0
  288. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts.map +1 -0
  289. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts +74 -0
  290. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts.map +1 -0
  291. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts +291 -0
  292. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts.map +1 -0
  293. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts +36 -0
  294. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts.map +1 -0
  295. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts +280 -0
  296. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts.map +1 -0
  297. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts +2 -0
  298. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts.map +1 -0
  299. package/templates/realtime-agent/node_modules/@supabase/phoenix/tsconfig.json +20 -0
  300. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/README.md +213 -0
  301. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs +5025 -0
  302. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs.map +1 -0
  303. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts +3828 -0
  304. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts.map +1 -0
  305. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts +3828 -0
  306. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts.map +1 -0
  307. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs +5017 -0
  308. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs.map +1 -0
  309. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/package.json +69 -0
  310. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestBuilder.ts +688 -0
  311. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestClient.ts +447 -0
  312. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestError.ts +41 -0
  313. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestFilterBuilder.ts +2137 -0
  314. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestQueryBuilder.ts +1703 -0
  315. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestTransformBuilder.ts +981 -0
  316. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/constants.ts +2 -0
  317. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/index.ts +34 -0
  318. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/parser.ts +476 -0
  319. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/result.ts +550 -0
  320. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/types.ts +129 -0
  321. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/utils.ts +704 -0
  322. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/common.ts +83 -0
  323. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/rpc.ts +148 -0
  324. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/feature-flags.ts +17 -0
  325. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/types.ts +161 -0
  326. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/version.ts +7 -0
  327. package/templates/realtime-agent/node_modules/@supabase/realtime-js/README.md +326 -0
  328. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts +442 -0
  329. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts.map +1 -0
  330. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js +719 -0
  331. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js.map +1 -0
  332. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts +275 -0
  333. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts.map +1 -0
  334. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js +697 -0
  335. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js.map +1 -0
  336. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts +62 -0
  337. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts.map +1 -0
  338. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js +43 -0
  339. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js.map +1 -0
  340. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts +6 -0
  341. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts.map +1 -0
  342. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js +18 -0
  343. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js.map +1 -0
  344. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts +43 -0
  345. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts.map +1 -0
  346. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js +43 -0
  347. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js.map +1 -0
  348. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts +10 -0
  349. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts.map +1 -0
  350. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js +29 -0
  351. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js.map +1 -0
  352. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts +33 -0
  353. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts.map +1 -0
  354. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js +155 -0
  355. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js.map +1 -0
  356. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts +109 -0
  357. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts.map +1 -0
  358. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js +241 -0
  359. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js.map +1 -0
  360. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts +2 -0
  361. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts.map +1 -0
  362. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js +11 -0
  363. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js.map +1 -0
  364. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts +82 -0
  365. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts.map +1 -0
  366. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js +130 -0
  367. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js.map +1 -0
  368. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts +32 -0
  369. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts.map +1 -0
  370. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js +103 -0
  371. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js.map +1 -0
  372. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts +53 -0
  373. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts.map +1 -0
  374. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js +93 -0
  375. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js.map +1 -0
  376. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts +38 -0
  377. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts.map +1 -0
  378. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js +114 -0
  379. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js.map +1 -0
  380. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts +5 -0
  381. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts.map +1 -0
  382. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js +3 -0
  383. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js.map +1 -0
  384. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts +442 -0
  385. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts.map +1 -0
  386. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js +714 -0
  387. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js.map +1 -0
  388. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts +275 -0
  389. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts.map +1 -0
  390. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js +693 -0
  391. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js.map +1 -0
  392. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts +62 -0
  393. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts.map +1 -0
  394. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js +38 -0
  395. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js.map +1 -0
  396. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts +6 -0
  397. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts.map +1 -0
  398. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js +6 -0
  399. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js.map +1 -0
  400. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts +43 -0
  401. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts.map +1 -0
  402. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js +40 -0
  403. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js.map +1 -0
  404. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts +10 -0
  405. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts.map +1 -0
  406. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js +26 -0
  407. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js.map +1 -0
  408. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts +33 -0
  409. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts.map +1 -0
  410. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js +152 -0
  411. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js.map +1 -0
  412. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts +109 -0
  413. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts.map +1 -0
  414. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js +229 -0
  415. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js.map +1 -0
  416. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts +2 -0
  417. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts.map +1 -0
  418. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js +8 -0
  419. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js.map +1 -0
  420. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts +82 -0
  421. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts.map +1 -0
  422. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js +126 -0
  423. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js.map +1 -0
  424. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts +32 -0
  425. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts.map +1 -0
  426. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js +100 -0
  427. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js.map +1 -0
  428. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts +53 -0
  429. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts.map +1 -0
  430. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js +90 -0
  431. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js.map +1 -0
  432. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts +38 -0
  433. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts.map +1 -0
  434. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js +111 -0
  435. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js.map +1 -0
  436. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts +5 -0
  437. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts.map +1 -0
  438. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js +2 -0
  439. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js.map +1 -0
  440. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.module.tsbuildinfo +1 -0
  441. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.tsbuildinfo +1 -0
  442. package/templates/realtime-agent/node_modules/@supabase/realtime-js/package.json +58 -0
  443. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeChannel.ts +1118 -0
  444. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeClient.ts +868 -0
  445. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimePresence.ts +71 -0
  446. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/index.ts +53 -0
  447. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/constants.ts +62 -0
  448. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/normalizeChannelError.ts +30 -0
  449. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/serializer.ts +203 -0
  450. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/transformers.ts +270 -0
  451. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/version.ts +7 -0
  452. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/websocket-factory.ts +204 -0
  453. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/channelAdapter.ts +149 -0
  454. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/presenceAdapter.ts +116 -0
  455. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/socketAdapter.ts +168 -0
  456. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/types.ts +32 -0
  457. package/templates/realtime-agent/node_modules/@supabase/storage-js/README.md +1262 -0
  458. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs +2995 -0
  459. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs.map +1 -0
  460. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts +2956 -0
  461. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts.map +1 -0
  462. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts +2956 -0
  463. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts.map +1 -0
  464. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs +2979 -0
  465. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs.map +1 -0
  466. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/umd/supabase.js +1 -0
  467. package/templates/realtime-agent/node_modules/@supabase/storage-js/package.json +62 -0
  468. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/StorageClient.ts +98 -0
  469. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/index.ts +19 -0
  470. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/BaseApiClient.ts +104 -0
  471. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/errors.ts +160 -0
  472. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/fetch.ts +303 -0
  473. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/headers.ts +43 -0
  474. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/helpers.ts +146 -0
  475. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/constants.ts +4 -0
  476. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/types.ts +654 -0
  477. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/version.ts +7 -0
  478. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/BlobDownloadBuilder.ts +62 -0
  479. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageAnalyticsClient.ts +420 -0
  480. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageBucketApi.ts +414 -0
  481. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageFileApi.ts +1423 -0
  482. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageVectorsClient.ts +644 -0
  483. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StreamDownloadBuilder.ts +39 -0
  484. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorBucketApi.ts +73 -0
  485. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorDataApi.ts +98 -0
  486. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorIndexApi.ts +90 -0
  487. package/templates/realtime-agent/node_modules/@supabase/supabase-js/README.md +238 -0
  488. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs +89 -0
  489. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs.map +1 -0
  490. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts +58 -0
  491. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts.map +1 -0
  492. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts +58 -0
  493. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts.map +1 -0
  494. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs +88 -0
  495. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs.map +1 -0
  496. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs +660 -0
  497. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs.map +1 -0
  498. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts +616 -0
  499. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts.map +1 -0
  500. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts +616 -0
  501. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts.map +1 -0
  502. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs +607 -0
  503. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs.map +1 -0
  504. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/umd/supabase.js +24 -0
  505. package/templates/realtime-agent/node_modules/@supabase/supabase-js/package.json +122 -0
  506. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/SupabaseClient.ts +625 -0
  507. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/cors.ts +84 -0
  508. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/index.ts +106 -0
  509. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/SupabaseAuthClient.ts +8 -0
  510. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/constants.ts +35 -0
  511. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/fetch.ts +36 -0
  512. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/helpers.ts +98 -0
  513. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/common.ts +93 -0
  514. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/rpc.ts +158 -0
  515. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/types.ts +196 -0
  516. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/version.ts +7 -0
  517. package/templates/realtime-agent/node_modules/iceberg-js/LICENSE +21 -0
  518. package/templates/realtime-agent/node_modules/iceberg-js/README.md +439 -0
  519. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs +596 -0
  520. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs.map +1 -0
  521. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.cts +547 -0
  522. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.ts +547 -0
  523. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs +587 -0
  524. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs.map +1 -0
  525. package/templates/realtime-agent/node_modules/iceberg-js/package.json +77 -0
  526. package/templates/realtime-agent/node_modules/tslib/CopyrightNotice.txt +15 -0
  527. package/templates/realtime-agent/node_modules/tslib/LICENSE.txt +12 -0
  528. package/templates/realtime-agent/node_modules/tslib/README.md +164 -0
  529. package/templates/realtime-agent/node_modules/tslib/SECURITY.md +41 -0
  530. package/templates/realtime-agent/node_modules/tslib/modules/index.d.ts +38 -0
  531. package/templates/realtime-agent/node_modules/tslib/modules/index.js +70 -0
  532. package/templates/realtime-agent/node_modules/tslib/modules/package.json +3 -0
  533. package/templates/realtime-agent/node_modules/tslib/package.json +47 -0
  534. package/templates/realtime-agent/node_modules/tslib/tslib.d.ts +460 -0
  535. package/templates/realtime-agent/node_modules/tslib/tslib.es6.html +1 -0
  536. package/templates/realtime-agent/node_modules/tslib/tslib.es6.js +402 -0
  537. package/templates/realtime-agent/node_modules/tslib/tslib.es6.mjs +401 -0
  538. package/templates/realtime-agent/node_modules/tslib/tslib.html +1 -0
  539. package/templates/realtime-agent/node_modules/tslib/tslib.js +484 -0
  540. package/templates/realtime-agent/package-lock.json +114 -0
  541. package/templates/realtime-agent/package.json +11 -0
  542. package/templates/realtime-agent/src/index.js +152 -0
  543. package/templates/root/AGENT.md +37 -0
  544. package/templates/root/model.md +1 -0
  545. package/templates/root/prompt.md +91 -0
  546. package/templates/root/ralph.sh +47 -0
@@ -0,0 +1,2917 @@
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 {
6
+ ServerCredentialCreationOptions,
7
+ ServerCredentialRequestOptions,
8
+ WebAuthnApi,
9
+ WebAuthnError,
10
+ } from './webauthn'
11
+ import type {
12
+ RegistrationResponseJSON,
13
+ AuthenticationResponseJSON,
14
+ ServerCredentialResponse,
15
+ } from './webauthn'
16
+ import {
17
+ AuthenticationCredential,
18
+ PublicKeyCredentialCreationOptionsFuture,
19
+ PublicKeyCredentialRequestOptionsFuture,
20
+ RegistrationCredential,
21
+ } from './webauthn.dom'
22
+
23
+ /** One of the providers supported by GoTrue. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`). */
24
+ export type Provider =
25
+ | 'apple'
26
+ | 'azure'
27
+ | 'bitbucket'
28
+ | 'discord'
29
+ | 'facebook'
30
+ | 'figma'
31
+ | 'github'
32
+ | 'gitlab'
33
+ | 'google'
34
+ | 'kakao'
35
+ | 'keycloak'
36
+ | 'linkedin'
37
+ | 'linkedin_oidc'
38
+ | 'notion'
39
+ | 'slack'
40
+ | 'slack_oidc'
41
+ | 'spotify'
42
+ | 'twitch'
43
+ /** Uses OAuth 1.0a */
44
+ | 'twitter'
45
+ /** Uses OAuth 2.0 */
46
+ | 'x'
47
+ | 'workos'
48
+ | 'zoom'
49
+ | 'fly'
50
+ | `custom:${string}`
51
+
52
+ export type AuthChangeEventMFA = 'MFA_CHALLENGE_VERIFIED'
53
+
54
+ export type AuthChangeEvent =
55
+ | 'INITIAL_SESSION'
56
+ | 'PASSWORD_RECOVERY'
57
+ | 'SIGNED_IN'
58
+ | 'SIGNED_OUT'
59
+ | 'TOKEN_REFRESHED'
60
+ | 'USER_UPDATED'
61
+ | AuthChangeEventMFA
62
+
63
+ /**
64
+ * Provide your own global lock implementation instead of the default
65
+ * implementation. The function should acquire a lock for the duration of the
66
+ * `fn` async function, such that no other client instances will be able to
67
+ * hold it at the same time.
68
+ *
69
+ * @experimental
70
+ *
71
+ * @param name Name of the lock to be acquired.
72
+ * @param acquireTimeout If negative, no timeout should occur. If positive it
73
+ * should throw an Error with an `isAcquireTimeout`
74
+ * property set to true if the operation fails to be
75
+ * acquired after this much time (ms).
76
+ * @param fn The operation to execute when the lock is acquired.
77
+ */
78
+ export type LockFunc = <R>(name: string, acquireTimeout: number, fn: () => Promise<R>) => Promise<R>
79
+
80
+ export type GoTrueClientOptions = {
81
+ /* The URL of the GoTrue server. */
82
+ url?: string
83
+ /* Any additional headers to send to the GoTrue server. */
84
+ headers?: { [key: string]: string }
85
+ /* Optional key name used for storing tokens in local storage. */
86
+ storageKey?: string
87
+ /**
88
+ * Set to "true" if you want to automatically detect OAuth grants in the URL and sign in the user.
89
+ * Set to "false" to disable automatic detection.
90
+ * Set to a function to provide custom logic for determining if a URL contains a Supabase auth callback.
91
+ * The function receives the current URL and parsed parameters, and should return true if the URL
92
+ * should be processed as a Supabase auth callback, or false to ignore it.
93
+ *
94
+ * This is useful when your app uses other OAuth providers (e.g., Facebook Login) that also return
95
+ * access_token in the URL fragment, which would otherwise be incorrectly intercepted by Supabase Auth.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * detectSessionInUrl: (url, params) => {
100
+ * // Ignore Facebook OAuth redirects
101
+ * if (url.pathname === '/facebook/redirect') return false
102
+ * // Use default detection for other URLs
103
+ * return Boolean(params.access_token || params.error_description)
104
+ * }
105
+ * ```
106
+ */
107
+ detectSessionInUrl?: boolean | ((url: URL, params: { [parameter: string]: string }) => boolean)
108
+ /* Set to "true" if you want to automatically refresh the token before expiring. */
109
+ autoRefreshToken?: boolean
110
+ /* Set to "true" if you want to automatically save the user session into local storage. If set to false, session will just be saved in memory. */
111
+ persistSession?: boolean
112
+ /* Provide your own local storage implementation to use instead of the browser's local storage. */
113
+ storage?: SupportedStorage
114
+ /**
115
+ * 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'`.
116
+ *
117
+ * 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.
118
+ *
119
+ * @experimental
120
+ */
121
+ userStorage?: SupportedStorage
122
+ /* A custom fetch implementation. */
123
+ fetch?: Fetch
124
+ /* If set to 'pkce' PKCE flow. Defaults to the 'implicit' flow otherwise */
125
+ flowType?: AuthFlowType
126
+ /* If debug messages are emitted. Can be used to inspect the behavior of the library. If set to a function, the provided function will be used instead of `console.log()` to perform the logging. */
127
+ debug?: boolean | ((message: string, ...args: any[]) => void)
128
+ /**
129
+ * Provide your own locking mechanism based on the environment. By default,
130
+ * `navigatorLock` (Web Locks API) is used in browser environments when
131
+ * `persistSession` is true. Falls back to an in-process lock for non-browser
132
+ * environments (e.g. React Native).
133
+ *
134
+ * @experimental
135
+ */
136
+ lock?: LockFunc
137
+ /**
138
+ * Set to "true" if there is a custom authorization header set globally.
139
+ * @experimental
140
+ */
141
+ hasCustomAuthorizationHeader?: boolean
142
+ /**
143
+ * If there is an error with the query, throwOnError will reject the promise by
144
+ * throwing the error instead of returning it as part of a successful response.
145
+ */
146
+ throwOnError?: boolean
147
+ /**
148
+ * The maximum time in milliseconds to wait for acquiring a cross-tab synchronization lock.
149
+ *
150
+ * When multiple browser tabs or windows use the auth client simultaneously, they coordinate
151
+ * via the Web Locks API to prevent race conditions during session refresh and other operations.
152
+ * This timeout controls how long to wait before attempting lock recovery.
153
+ *
154
+ * - **Positive value**: Wait up to this many milliseconds. If the lock is still held, attempt
155
+ * automatic recovery by stealing it (the previous holder is evicted, its callback continues
156
+ * to completion without exclusive access). This recovers from orphaned locks caused by
157
+ * React Strict Mode double-mount, storage API hangs, or aborted operations.
158
+ * - **Zero (0)**: Fail immediately if the lock is unavailable; throws `LockAcquireTimeoutError`
159
+ * (check `error.isAcquireTimeout === true`).
160
+ * - **Negative value**: Wait indefinitely — can cause permanent deadlocks if the lock is orphaned.
161
+ *
162
+ * @default 5000
163
+ *
164
+ * @example
165
+ * ```ts
166
+ * const client = createClient(url, key, {
167
+ * auth: {
168
+ * lockAcquireTimeout: 5000, // 5 seconds, then steal orphaned lock
169
+ * },
170
+ * })
171
+ * ```
172
+ */
173
+ lockAcquireTimeout?: number
174
+
175
+ /**
176
+ * If true, skips automatic initialization in constructor. Useful for SSR
177
+ * contexts where initialization timing must be controlled to prevent race
178
+ * conditions with HTTP response generation.
179
+ *
180
+ * @default false
181
+ */
182
+ skipAutoInitialize?: boolean
183
+
184
+ /**
185
+ * Opt-in flags for experimental features. These APIs may change without
186
+ * notice and are disabled by default.
187
+ *
188
+ * @experimental
189
+ */
190
+ experimental?: ExperimentalFeatureFlags
191
+ }
192
+
193
+ export type ExperimentalFeatureFlags = {
194
+ /**
195
+ * Enables passkey support:
196
+ * - `auth.signInWithPasskey()`, `auth.registerPasskey()`
197
+ * - `auth.passkey.*`
198
+ * - `auth.admin.passkey.*`
199
+ *
200
+ * Defaults to `false`. Calling any passkey method while this flag is
201
+ * disabled throws a descriptive error at call time.
202
+ */
203
+ passkey?: boolean
204
+ }
205
+
206
+ const WeakPasswordReasons = ['length', 'characters', 'pwned'] as const
207
+
208
+ export type WeakPasswordReasons = (typeof WeakPasswordReasons)[number]
209
+ export type WeakPassword = {
210
+ reasons: WeakPasswordReasons[]
211
+ message: string
212
+ }
213
+
214
+ /**
215
+ * Resolve mapped types and show the derived keys and their types when hovering in
216
+ * VS Code, instead of just showing the names those mapped types are defined with.
217
+ */
218
+ export type Prettify<T> = T extends Function ? T : { [K in keyof T]: T[K] }
219
+
220
+ /**
221
+ * A stricter version of TypeScript's Omit that only allows omitting keys that actually exist.
222
+ * This prevents typos and ensures type safety at compile time.
223
+ * Unlike regular Omit, this will error if you try to omit a non-existent key.
224
+ */
225
+ export type StrictOmit<T, K extends keyof T> = Omit<T, K>
226
+
227
+ /**
228
+ * a shared result type that encapsulates errors instead of throwing them, allows you to optionally specify the ErrorType
229
+ */
230
+ export type RequestResult<T, ErrorType extends Error = AuthError> =
231
+ | {
232
+ data: T
233
+ error: null
234
+ }
235
+ | {
236
+ data: null
237
+ error: Error extends AuthError ? AuthError : ErrorType
238
+ }
239
+
240
+ /**
241
+ * similar to RequestResult except it allows you to destructure the possible shape of the success response
242
+ * {@see RequestResult}
243
+ */
244
+ export type RequestResultSafeDestructure<T> =
245
+ | { data: T; error: null }
246
+ | {
247
+ data: T extends object ? { [K in keyof T]: null } : null
248
+ error: AuthError
249
+ }
250
+
251
+ export type AuthResponse = RequestResultSafeDestructure<{
252
+ user: User | null
253
+ session: Session | null
254
+ }>
255
+
256
+ export type AuthResponsePassword = RequestResultSafeDestructure<{
257
+ user: User | null
258
+ session: Session | null
259
+ weak_password?: WeakPassword | null
260
+ }>
261
+
262
+ /**
263
+ * AuthOtpResponse is returned when OTP is used.
264
+ *
265
+ * {@see AuthResponse}
266
+ */
267
+ export type AuthOtpResponse = RequestResultSafeDestructure<{
268
+ user: null
269
+ session: null
270
+ messageId?: string | null
271
+ }>
272
+
273
+ export type AuthTokenResponse = RequestResultSafeDestructure<{
274
+ user: User
275
+ session: Session
276
+ }>
277
+
278
+ export type AuthTokenResponsePassword = RequestResultSafeDestructure<{
279
+ user: User
280
+ session: Session
281
+ weakPassword?: WeakPassword
282
+ }>
283
+
284
+ export type OAuthResponse =
285
+ | {
286
+ data: {
287
+ provider: Provider
288
+ url: string
289
+ }
290
+ error: null
291
+ }
292
+ | {
293
+ data: {
294
+ provider: Provider
295
+ url: null
296
+ }
297
+ error: AuthError
298
+ }
299
+
300
+ export type SSOResponse = RequestResult<{
301
+ /**
302
+ * URL to open in a browser which will complete the sign-in flow by
303
+ * taking the user to the identity provider's authentication flow.
304
+ *
305
+ * On browsers you can set the URL to `window.location.href` to take
306
+ * the user to the authentication flow.
307
+ */
308
+ url: string
309
+ }>
310
+
311
+ export type UserResponse = RequestResultSafeDestructure<{
312
+ user: User
313
+ }>
314
+
315
+ export interface Session {
316
+ /**
317
+ * The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.
318
+ */
319
+ provider_token?: string | null
320
+ /**
321
+ * The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.
322
+ * 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.
323
+ */
324
+ provider_refresh_token?: string | null
325
+ /**
326
+ * The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.
327
+ */
328
+ access_token: string
329
+ /**
330
+ * A one-time used refresh token that never expires.
331
+ */
332
+ refresh_token: string
333
+ /**
334
+ * The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.
335
+ */
336
+ expires_in: number
337
+ /**
338
+ * A timestamp of when the token will expire. Returned when a login is confirmed.
339
+ */
340
+ expires_at?: number
341
+ token_type: 'bearer'
342
+
343
+ /**
344
+ * When using a separate user storage, accessing properties of this object will throw an error.
345
+ */
346
+ user: User
347
+ }
348
+
349
+ const AMRMethods = [
350
+ 'password',
351
+ 'otp',
352
+ 'oauth',
353
+ 'totp',
354
+ 'mfa/totp',
355
+ 'mfa/phone',
356
+ 'mfa/webauthn',
357
+ 'anonymous',
358
+ 'sso/saml',
359
+ 'magiclink',
360
+ 'web3',
361
+ 'oauth_provider/authorization_code',
362
+ ] as const
363
+
364
+ export type AMRMethod = (typeof AMRMethods)[number] | (string & {})
365
+
366
+ /**
367
+ * An authentication method reference (AMR) entry.
368
+ *
369
+ * An entry designates what method was used by the user to verify their
370
+ * identity and at what time.
371
+ *
372
+ * Note: Custom access token hooks can return AMR claims as either:
373
+ * - An array of AMREntry objects (detailed format with timestamps)
374
+ * - An array of strings (RFC-8176 compliant format)
375
+ *
376
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}.
377
+ */
378
+ export interface AMREntry {
379
+ /** Authentication method name. */
380
+ method: AMRMethod
381
+
382
+ /**
383
+ * Timestamp when the method was successfully used. Represents number of
384
+ * seconds since 1st January 1970 (UNIX epoch) in UTC.
385
+ */
386
+ timestamp: number
387
+ }
388
+
389
+ export interface UserIdentity {
390
+ id: string
391
+ user_id: string
392
+ identity_data?: {
393
+ [key: string]: any
394
+ }
395
+ identity_id: string
396
+ provider: string
397
+ created_at?: string
398
+ last_sign_in_at?: string
399
+ updated_at?: string
400
+ }
401
+
402
+ const FactorTypes = ['totp', 'phone', 'webauthn'] as const
403
+
404
+ /**
405
+ * Type of factor. `totp` and `phone` supported with this version
406
+ */
407
+ export type FactorType = (typeof FactorTypes)[number]
408
+
409
+ const FactorVerificationStatuses = ['verified', 'unverified'] as const
410
+
411
+ /**
412
+ * The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`
413
+ */
414
+ type FactorVerificationStatus = (typeof FactorVerificationStatuses)[number]
415
+
416
+ /**
417
+ * A MFA factor.
418
+ *
419
+ * @see {@link GoTrueMFAApi#enroll}
420
+ * @see {@link GoTrueMFAApi#listFactors}
421
+ * @see {@link GoTrueMFAAdminApi#listFactors}
422
+ */
423
+ export type Factor<
424
+ Type extends FactorType = FactorType,
425
+ Status extends FactorVerificationStatus = (typeof FactorVerificationStatuses)[number],
426
+ > = {
427
+ /** ID of the factor. */
428
+ id: string
429
+
430
+ /** Friendly name of the factor, useful to disambiguate between multiple factors. */
431
+ friendly_name?: string
432
+
433
+ /**
434
+ * Type of factor. `totp` and `phone` supported with this version
435
+ */
436
+ factor_type: Type
437
+
438
+ /**
439
+ * The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`
440
+ */
441
+ status: Status
442
+
443
+ created_at: string
444
+ updated_at: string
445
+ last_challenged_at?: string
446
+ }
447
+
448
+ export interface UserAppMetadata {
449
+ /**
450
+ * The first provider that the user used to sign up with.
451
+ */
452
+ provider?: string
453
+ /**
454
+ * A list of all providers that the user has linked to their account.
455
+ */
456
+ providers?: string[]
457
+ [key: string]: any
458
+ }
459
+
460
+ export interface UserMetadata {
461
+ [key: string]: any
462
+ }
463
+
464
+ export interface User {
465
+ id: string
466
+ app_metadata: UserAppMetadata
467
+ user_metadata: UserMetadata
468
+ aud: string
469
+ confirmation_sent_at?: string
470
+ recovery_sent_at?: string
471
+ email_change_sent_at?: string
472
+ new_email?: string
473
+ new_phone?: string
474
+ invited_at?: string
475
+ action_link?: string
476
+ email?: string
477
+ phone?: string
478
+ created_at: string
479
+ confirmed_at?: string
480
+ email_confirmed_at?: string
481
+ phone_confirmed_at?: string
482
+ last_sign_in_at?: string
483
+ role?: string
484
+ updated_at?: string
485
+ identities?: UserIdentity[]
486
+ is_anonymous?: boolean
487
+ is_sso_user?: boolean
488
+ factors?: (Factor<FactorType, 'verified'> | Factor<FactorType, 'unverified'>)[]
489
+ deleted_at?: string
490
+ banned_until?: string
491
+ }
492
+
493
+ export interface UserAttributes {
494
+ /**
495
+ * The user's current password
496
+ *
497
+ * This is only ever present when the user is resetting
498
+ * their password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true.
499
+ *
500
+ */
501
+ current_password?: string
502
+
503
+ /**
504
+ * The user's email.
505
+ */
506
+ email?: string
507
+
508
+ /**
509
+ * The user's phone.
510
+ */
511
+ phone?: string
512
+
513
+ /**
514
+ * The user's password.
515
+ */
516
+ password?: string
517
+
518
+ /**
519
+ * The nonce sent for reauthentication if the user's password is to be updated.
520
+ *
521
+ * Call reauthenticate() to obtain the nonce first.
522
+ */
523
+ nonce?: string
524
+
525
+ /**
526
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
527
+ *
528
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
529
+ *
530
+ */
531
+ data?: object
532
+ }
533
+
534
+ export interface AdminUserAttributes extends Omit<UserAttributes, 'data'> {
535
+ /**
536
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
537
+ *
538
+ *
539
+ * The `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.
540
+ *
541
+ * Note: When using the GoTrueAdminApi and wanting to modify a user's metadata,
542
+ * this attribute is used instead of UserAttributes data.
543
+ *
544
+ */
545
+ user_metadata?: object
546
+
547
+ /**
548
+ * A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.
549
+ *
550
+ * Only a service role can modify.
551
+ *
552
+ * The `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other
553
+ * access control information.
554
+ */
555
+ app_metadata?: object
556
+
557
+ /**
558
+ * Sets the user's email as confirmed when true, or unconfirmed when false.
559
+ *
560
+ * Only a service role can modify.
561
+ */
562
+ email_confirm?: boolean
563
+
564
+ /**
565
+ * Sets the user's phone as confirmed when true, or unconfirmed when false.
566
+ *
567
+ * Only a service role can modify.
568
+ */
569
+ phone_confirm?: boolean
570
+
571
+ /**
572
+ * Determines how long a user is banned for.
573
+ *
574
+ * The format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.
575
+ * Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
576
+ *
577
+ * For example, some possible durations include: '300ms', '2h45m'.
578
+ *
579
+ * Setting the ban duration to 'none' lifts the ban on the user.
580
+ */
581
+ ban_duration?: string | 'none'
582
+
583
+ /**
584
+ * The `role` claim set in the user's access token JWT.
585
+ *
586
+ * 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.
587
+ *
588
+ * Setting this role to `service_role` is not recommended as it grants the user admin privileges.
589
+ */
590
+ role?: string
591
+
592
+ /**
593
+ * The `password_hash` for the user's password.
594
+ *
595
+ * Allows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.
596
+ *
597
+ * Supports bcrypt, scrypt (firebase), and argon2 password hashes.
598
+ */
599
+ password_hash?: string
600
+
601
+ /**
602
+ * The `id` for the user.
603
+ *
604
+ * Allows you to overwrite the default `id` set for the user.
605
+ */
606
+ id?: string
607
+ }
608
+
609
+ export interface Subscription {
610
+ /**
611
+ * A unique identifier for this subscription, set by the client.
612
+ * This is an internal identifier used for managing callbacks and should not be
613
+ * relied upon by application code. Use the unsubscribe() method to remove listeners.
614
+ */
615
+ id: string | symbol
616
+ /**
617
+ * The function to call every time there is an event. eg: (eventName) => {}
618
+ */
619
+ callback: (event: AuthChangeEvent, session: Session | null) => void
620
+ /**
621
+ * Call this to remove the listener.
622
+ */
623
+ unsubscribe: () => void
624
+ }
625
+
626
+ export type SignInAnonymouslyCredentials = {
627
+ options?: {
628
+ /**
629
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
630
+ *
631
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
632
+ */
633
+ data?: object
634
+ /** Verification token received when the user completes the captcha on the site. */
635
+ captchaToken?: string
636
+ }
637
+ }
638
+
639
+ export type SignUpWithPasswordCredentials = PasswordCredentialsBase & {
640
+ options?: {
641
+ emailRedirectTo?: string // only for email
642
+ data?: object
643
+ captchaToken?: string
644
+ channel?: 'sms' | 'whatsapp' // only for phone
645
+ }
646
+ }
647
+
648
+ type PasswordCredentialsBase =
649
+ | { email: string; password: string }
650
+ | { phone: string; password: string }
651
+
652
+ export type SignInWithPasswordCredentials = PasswordCredentialsBase & {
653
+ options?: {
654
+ captchaToken?: string
655
+ }
656
+ }
657
+
658
+ export type SignInWithPasswordlessCredentials =
659
+ | {
660
+ /** The user's email address. */
661
+ email: string
662
+ options?: {
663
+ /** The redirect url embedded in the email link */
664
+ emailRedirectTo?: string
665
+ /** If set to false, this method will not create a new user. Defaults to true. */
666
+ shouldCreateUser?: boolean
667
+ /**
668
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
669
+ *
670
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
671
+ */
672
+ data?: object
673
+ /** Verification token received when the user completes the captcha on the site. */
674
+ captchaToken?: string
675
+ }
676
+ }
677
+ | {
678
+ /** The user's phone number. */
679
+ phone: string
680
+ options?: {
681
+ /** If set to false, this method will not create a new user. Defaults to true. */
682
+ shouldCreateUser?: boolean
683
+ /**
684
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
685
+ *
686
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
687
+ */
688
+ data?: object
689
+ /** Verification token received when the user completes the captcha on the site. */
690
+ captchaToken?: string
691
+ /** Messaging channel to use (e.g. whatsapp or sms) */
692
+ channel?: 'sms' | 'whatsapp'
693
+ }
694
+ }
695
+
696
+ export type AuthFlowType = 'implicit' | 'pkce' | (string & {})
697
+ export type SignInWithOAuthCredentials = {
698
+ /** One of the providers supported by GoTrue. */
699
+ provider: Provider
700
+ options?: {
701
+ /** A URL to send the user to after they are confirmed. */
702
+ redirectTo?: string
703
+ /** A space-separated list of scopes granted to the OAuth application. */
704
+ scopes?: string
705
+ /** An object of query params */
706
+ queryParams?: { [key: string]: string }
707
+ /** If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider. */
708
+ skipBrowserRedirect?: boolean
709
+ }
710
+ }
711
+
712
+ export type SignInWithIdTokenCredentials = {
713
+ /** 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`). */
714
+ provider: 'google' | 'apple' | 'azure' | 'facebook' | 'kakao' | `custom:${string}` | (string & {})
715
+ /** 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. */
716
+ token: string
717
+ /** If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token. */
718
+ access_token?: string
719
+ /** If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token. */
720
+ nonce?: string
721
+ options?: {
722
+ /** Verification token received when the user completes the captcha on the site. */
723
+ captchaToken?: string
724
+ }
725
+ }
726
+
727
+ export type SolanaWallet = {
728
+ signIn?: (...inputs: SolanaSignInInput[]) => Promise<SolanaSignInOutput | SolanaSignInOutput[]>
729
+ publicKey?: {
730
+ toBase58: () => string
731
+ } | null
732
+
733
+ signMessage?: (message: Uint8Array, encoding?: 'utf8' | string) => Promise<Uint8Array> | undefined
734
+ }
735
+
736
+ export type SolanaWeb3Credentials =
737
+ | {
738
+ chain: 'solana'
739
+
740
+ /** Wallet interface to use. If not specified will default to `window.solana`. */
741
+ wallet?: SolanaWallet
742
+
743
+ /** 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!** */
744
+ statement?: string
745
+
746
+ options?: {
747
+ /** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
748
+ url?: string
749
+
750
+ /** Verification token received when the user completes the captcha on the site. */
751
+ captchaToken?: string
752
+
753
+ signInWithSolana?: Partial<
754
+ Omit<SolanaSignInInput, 'version' | 'chain' | 'domain' | 'uri' | 'statement'>
755
+ >
756
+ }
757
+ }
758
+ | {
759
+ chain: 'solana'
760
+
761
+ /** Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`. */
762
+ message: string
763
+
764
+ /** Ed25519 signature of the message. */
765
+ signature: Uint8Array
766
+
767
+ options?: {
768
+ /** Verification token received when the user completes the captcha on the site. */
769
+ captchaToken?: string
770
+ }
771
+ }
772
+
773
+ export type EthereumWallet = EIP1193Provider
774
+
775
+ export type EthereumWeb3Credentials =
776
+ | {
777
+ chain: 'ethereum'
778
+
779
+ /** Wallet interface to use. If not specified will default to `window.ethereum`. */
780
+ wallet?: EthereumWallet
781
+
782
+ /** 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!** */
783
+ statement?: string
784
+
785
+ options?: {
786
+ /** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
787
+ url?: string
788
+
789
+ /** Verification token received when the user completes the captcha on the site. */
790
+ captchaToken?: string
791
+
792
+ signInWithEthereum?: Partial<
793
+ Omit<EthereumSignInInput, 'version' | 'domain' | 'uri' | 'statement'>
794
+ >
795
+ }
796
+ }
797
+ | {
798
+ chain: 'ethereum'
799
+
800
+ /** Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`. */
801
+ message: string
802
+
803
+ /** Ethereum curve (secp256k1) signature of the message. */
804
+ signature: Hex
805
+
806
+ options?: {
807
+ /** Verification token received when the user completes the captcha on the site. */
808
+ captchaToken?: string
809
+ }
810
+ }
811
+
812
+ export type Web3Credentials = SolanaWeb3Credentials | EthereumWeb3Credentials
813
+
814
+ export type VerifyOtpParams = VerifyMobileOtpParams | VerifyEmailOtpParams | VerifyTokenHashParams
815
+ export interface VerifyMobileOtpParams {
816
+ /** The user's phone number. */
817
+ phone: string
818
+ /** The otp sent to the user's phone number. */
819
+ token: string
820
+ /** The user's verification type. */
821
+ type: MobileOtpType
822
+ options?: {
823
+ /** A URL to send the user to after they are confirmed. */
824
+ redirectTo?: string
825
+
826
+ /**
827
+ * Verification token received when the user completes the captcha on the site.
828
+ *
829
+ * @deprecated
830
+ */
831
+ captchaToken?: string
832
+ }
833
+ }
834
+ export interface VerifyEmailOtpParams {
835
+ /** The user's email address. */
836
+ email: string
837
+ /** The otp sent to the user's email address. */
838
+ token: string
839
+ /** The user's verification type. */
840
+ type: EmailOtpType
841
+ options?: {
842
+ /** A URL to send the user to after they are confirmed. */
843
+ redirectTo?: string
844
+
845
+ /** Verification token received when the user completes the captcha on the site.
846
+ *
847
+ * @deprecated
848
+ */
849
+ captchaToken?: string
850
+ }
851
+ }
852
+
853
+ export interface VerifyTokenHashParams {
854
+ /** The token hash used in an email link */
855
+ token_hash: string
856
+
857
+ /** The user's verification type. */
858
+ type: EmailOtpType
859
+ }
860
+
861
+ export type MobileOtpType = 'sms' | 'phone_change' | (string & {})
862
+ export type EmailOtpType =
863
+ | 'signup'
864
+ | 'invite'
865
+ | 'magiclink'
866
+ | 'recovery'
867
+ | 'email_change'
868
+ | 'email'
869
+ | (string & {})
870
+
871
+ export type ResendParams =
872
+ | {
873
+ type: Extract<EmailOtpType, 'signup' | 'email_change'>
874
+ email: string
875
+ options?: {
876
+ /** A URL to send the user to after they have signed-in. */
877
+ emailRedirectTo?: string
878
+ /** Verification token received when the user completes the captcha on the site. */
879
+ captchaToken?: string
880
+ }
881
+ }
882
+ | {
883
+ type: Extract<MobileOtpType, 'sms' | 'phone_change'>
884
+ phone: string
885
+ options?: {
886
+ /** Verification token received when the user completes the captcha on the site. */
887
+ captchaToken?: string
888
+ }
889
+ }
890
+
891
+ export type SignInWithSSO =
892
+ | {
893
+ /** UUID of the SSO provider to invoke single-sign on to. */
894
+ providerId: string
895
+
896
+ options?: {
897
+ /** A URL to send the user to after they have signed-in. */
898
+ redirectTo?: string
899
+ /** Verification token received when the user completes the captcha on the site. */
900
+ captchaToken?: string
901
+ /**
902
+ * If set to true, the redirect will not happen on the client side.
903
+ * This parameter is used when you wish to handle the redirect yourself.
904
+ * Defaults to false.
905
+ */
906
+ skipBrowserRedirect?: boolean
907
+ }
908
+ }
909
+ | {
910
+ /** Domain name of the organization for which to invoke single-sign on. */
911
+ domain: string
912
+
913
+ options?: {
914
+ /** A URL to send the user to after they have signed-in. */
915
+ redirectTo?: string
916
+ /** Verification token received when the user completes the captcha on the site. */
917
+ captchaToken?: string
918
+ /**
919
+ * If set to true, the redirect will not happen on the client side.
920
+ * This parameter is used when you wish to handle the redirect yourself.
921
+ * Defaults to false.
922
+ */
923
+ skipBrowserRedirect?: boolean
924
+ }
925
+ }
926
+
927
+ export type GenerateSignupLinkParams = {
928
+ type: 'signup'
929
+ email: string
930
+ password: string
931
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>
932
+ }
933
+
934
+ export type GenerateInviteOrMagiclinkParams = {
935
+ type: 'invite' | 'magiclink'
936
+ /** The user's email */
937
+ email: string
938
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>
939
+ }
940
+
941
+ export type GenerateRecoveryLinkParams = {
942
+ type: 'recovery'
943
+ /** The user's email */
944
+ email: string
945
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>
946
+ }
947
+
948
+ export type GenerateEmailChangeLinkParams = {
949
+ type: 'email_change_current' | 'email_change_new'
950
+ /** The user's email */
951
+ email: string
952
+ /**
953
+ * The user's new email. Only required if type is 'email_change_current' or 'email_change_new'.
954
+ */
955
+ newEmail: string
956
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>
957
+ }
958
+
959
+ export interface GenerateLinkOptions {
960
+ /**
961
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
962
+ *
963
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
964
+ */
965
+ data?: object
966
+ /** The URL which will be appended to the email link generated. */
967
+ redirectTo?: string
968
+ }
969
+
970
+ export type GenerateLinkParams =
971
+ | GenerateSignupLinkParams
972
+ | GenerateInviteOrMagiclinkParams
973
+ | GenerateRecoveryLinkParams
974
+ | GenerateEmailChangeLinkParams
975
+
976
+ export type GenerateLinkResponse = RequestResultSafeDestructure<{
977
+ properties: GenerateLinkProperties
978
+ user: User
979
+ }>
980
+
981
+ /** The properties related to the email link generated */
982
+ export type GenerateLinkProperties = {
983
+ /**
984
+ * The email link to send to the user.
985
+ * The action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}
986
+ * */
987
+ action_link: string
988
+ /**
989
+ * The raw email OTP.
990
+ * You should send this in the email if you want your users to verify using an OTP instead of the action link.
991
+ * */
992
+ email_otp: string
993
+ /**
994
+ * The hashed token appended to the action link.
995
+ * */
996
+ hashed_token: string
997
+ /** The URL appended to the action link. */
998
+ redirect_to: string
999
+ /** The verification type that the email link is associated to. */
1000
+ verification_type: GenerateLinkType
1001
+ }
1002
+
1003
+ export type GenerateLinkType =
1004
+ | 'signup'
1005
+ | 'invite'
1006
+ | 'magiclink'
1007
+ | 'recovery'
1008
+ | 'email_change_current'
1009
+ | 'email_change_new'
1010
+
1011
+ export type MFAEnrollParams = MFAEnrollTOTPParams | MFAEnrollPhoneParams | MFAEnrollWebauthnParams
1012
+
1013
+ export type MFAUnenrollParams = {
1014
+ /** ID of the factor being unenrolled. */
1015
+ factorId: string
1016
+ }
1017
+
1018
+ type MFAVerifyParamsBase = {
1019
+ /** ID of the factor being verified. Returned in enroll(). */
1020
+ factorId: string
1021
+ /** ID of the challenge being verified. Returned in challenge(). */
1022
+ challengeId: string
1023
+ }
1024
+
1025
+ type MFAVerifyTOTPParamFields = {
1026
+ /** Verification code provided by the user. */
1027
+ code: string
1028
+ }
1029
+
1030
+ export type MFAVerifyTOTPParams = MFAVerifyParamsBase & MFAVerifyTOTPParamFields
1031
+
1032
+ type MFAVerifyPhoneParamFields = MFAVerifyTOTPParamFields
1033
+
1034
+ export type MFAVerifyPhoneParams = MFAVerifyParamsBase & MFAVerifyPhoneParamFields
1035
+
1036
+ type MFAVerifyWebauthnParamFieldsBase = {
1037
+ /** Relying party ID */
1038
+ rpId: string
1039
+ /** Relying party origins */
1040
+ rpOrigins?: string[]
1041
+ }
1042
+
1043
+ type MFAVerifyWebauthnCredentialParamFields<T extends 'create' | 'request' = 'create' | 'request'> =
1044
+ {
1045
+ /** Operation type */
1046
+ type: T
1047
+ /** Creation response from the authenticator (for enrollment/unverified factors) */
1048
+ credential_response: T extends 'create' ? RegistrationCredential : AuthenticationCredential
1049
+ }
1050
+
1051
+ /**
1052
+ * WebAuthn-specific fields for MFA verification.
1053
+ * Supports both credential creation (registration) and request (authentication) flows.
1054
+ * @template T - Type of WebAuthn operation: 'create' for registration, 'request' for authentication
1055
+ */
1056
+ export type MFAVerifyWebauthnParamFields<T extends 'create' | 'request' = 'create' | 'request'> = {
1057
+ webauthn: MFAVerifyWebauthnParamFieldsBase & MFAVerifyWebauthnCredentialParamFields<T>
1058
+ }
1059
+
1060
+ /**
1061
+ * Parameters for WebAuthn MFA verification.
1062
+ * Used to verify WebAuthn credentials after challenge.
1063
+ * @template T - Type of WebAuthn operation: 'create' for registration, 'request' for authentication
1064
+ * @see {@link https://w3c.github.io/webauthn/#sctn-verifying-assertion W3C WebAuthn Spec - Verifying an Authentication Assertion}
1065
+ */
1066
+ export type MFAVerifyWebauthnParams<T extends 'create' | 'request' = 'create' | 'request'> =
1067
+ MFAVerifyParamsBase & MFAVerifyWebauthnParamFields<T>
1068
+
1069
+ export type MFAVerifyParams = MFAVerifyTOTPParams | MFAVerifyPhoneParams | MFAVerifyWebauthnParams
1070
+
1071
+ type MFAChallengeParamsBase = {
1072
+ /** ID of the factor to be challenged. Returned in enroll(). */
1073
+ factorId: string
1074
+ }
1075
+
1076
+ const MFATOTPChannels = ['sms', 'whatsapp'] as const
1077
+ export type MFATOTPChannel = (typeof MFATOTPChannels)[number]
1078
+
1079
+ export type MFAChallengeTOTPParams = MFAChallengeParamsBase
1080
+
1081
+ type MFAChallengePhoneParamFields<Channel extends MFATOTPChannel = MFATOTPChannel> = {
1082
+ /** Messaging channel to use (e.g. whatsapp or sms). Only relevant for phone factors */
1083
+ channel: Channel
1084
+ }
1085
+
1086
+ export type MFAChallengePhoneParams = MFAChallengeParamsBase & MFAChallengePhoneParamFields
1087
+
1088
+ /** WebAuthn parameters for WebAuthn factor challenge */
1089
+ type MFAChallengeWebauthnParamFields = {
1090
+ webauthn: {
1091
+ /** Relying party ID */
1092
+ rpId: string
1093
+ /** Relying party origins*/
1094
+ rpOrigins?: string[]
1095
+ }
1096
+ }
1097
+
1098
+ /**
1099
+ * Parameters for initiating a WebAuthn MFA challenge.
1100
+ * Includes Relying Party information needed for WebAuthn ceremonies.
1101
+ * @see {@link https://w3c.github.io/webauthn/#sctn-rp-operations W3C WebAuthn Spec - Relying Party Operations}
1102
+ */
1103
+ export type MFAChallengeWebauthnParams = MFAChallengeParamsBase & MFAChallengeWebauthnParamFields
1104
+
1105
+ export type MFAChallengeParams =
1106
+ | MFAChallengeTOTPParams
1107
+ | MFAChallengePhoneParams
1108
+ | MFAChallengeWebauthnParams
1109
+
1110
+ type MFAChallengeAndVerifyParamsBase = Omit<MFAVerifyParamsBase, 'challengeId'>
1111
+
1112
+ type MFAChallengeAndVerifyTOTPParamFields = MFAVerifyTOTPParamFields
1113
+
1114
+ type MFAChallengeAndVerifyTOTPParams = MFAChallengeAndVerifyParamsBase &
1115
+ MFAChallengeAndVerifyTOTPParamFields
1116
+
1117
+ export type MFAChallengeAndVerifyParams = MFAChallengeAndVerifyTOTPParams
1118
+
1119
+ /**
1120
+ * Data returned after successful MFA verification.
1121
+ * Contains new session tokens and updated user information.
1122
+ */
1123
+ export type AuthMFAVerifyResponseData = {
1124
+ /** New access token (JWT) after successful verification. */
1125
+ access_token: string
1126
+
1127
+ /** Type of token, always `bearer`. */
1128
+ token_type: 'bearer'
1129
+
1130
+ /** Number of seconds in which the access token will expire. */
1131
+ expires_in: number
1132
+
1133
+ /** Refresh token you can use to obtain new access tokens when expired. */
1134
+ refresh_token: string
1135
+
1136
+ /** Updated user profile. */
1137
+ user: User
1138
+ }
1139
+
1140
+ /**
1141
+ * Response type for MFA verification operations.
1142
+ * Returns session tokens on successful verification.
1143
+ */
1144
+ export type AuthMFAVerifyResponse = RequestResult<AuthMFAVerifyResponseData>
1145
+
1146
+ export type AuthMFAEnrollResponse =
1147
+ | AuthMFAEnrollTOTPResponse
1148
+ | AuthMFAEnrollPhoneResponse
1149
+ | AuthMFAEnrollWebauthnResponse
1150
+
1151
+ export type AuthMFAUnenrollResponse = RequestResult<{
1152
+ /** ID of the factor that was successfully unenrolled. */
1153
+ id: string
1154
+ }>
1155
+
1156
+ type AuthMFAChallengeResponseBase<T extends FactorType> = {
1157
+ /** ID of the newly created challenge. */
1158
+ id: string
1159
+
1160
+ /** Factor Type which generated the challenge */
1161
+ type: T
1162
+
1163
+ /** Timestamp in UNIX seconds when this challenge will no longer be usable. */
1164
+ expires_at: number
1165
+ }
1166
+
1167
+ type AuthMFAChallengeTOTPResponseFields = {
1168
+ /** no extra fields for now, kept for consistency and for possible future changes */
1169
+ }
1170
+
1171
+ export type AuthMFAChallengeTOTPResponse = RequestResult<
1172
+ AuthMFAChallengeResponseBase<'totp'> & AuthMFAChallengeTOTPResponseFields
1173
+ >
1174
+
1175
+ type AuthMFAChallengePhoneResponseFields = {
1176
+ /** no extra fields for now, kept for consistency and for possible future changes */
1177
+ }
1178
+
1179
+ export type AuthMFAChallengePhoneResponse = RequestResult<
1180
+ AuthMFAChallengeResponseBase<'phone'> & AuthMFAChallengePhoneResponseFields
1181
+ >
1182
+
1183
+ type AuthMFAChallengeWebauthnResponseFields = {
1184
+ webauthn:
1185
+ | {
1186
+ type: 'create'
1187
+ credential_options: { publicKey: PublicKeyCredentialCreationOptionsFuture }
1188
+ }
1189
+ | {
1190
+ type: 'request'
1191
+ credential_options: { publicKey: PublicKeyCredentialRequestOptionsFuture }
1192
+ }
1193
+ }
1194
+
1195
+ /**
1196
+ * Response type for WebAuthn MFA challenge.
1197
+ * Contains credential creation or request options from the server.
1198
+ * @see {@link https://w3c.github.io/webauthn/#sctn-credential-creation W3C WebAuthn Spec - Credential Creation}
1199
+ */
1200
+ export type AuthMFAChallengeWebauthnResponse = RequestResult<
1201
+ AuthMFAChallengeResponseBase<'webauthn'> & AuthMFAChallengeWebauthnResponseFields
1202
+ >
1203
+
1204
+ type AuthMFAChallengeWebauthnResponseFieldsJSON = {
1205
+ webauthn:
1206
+ | {
1207
+ type: 'create'
1208
+ credential_options: { publicKey: ServerCredentialCreationOptions }
1209
+ }
1210
+ | {
1211
+ type: 'request'
1212
+ credential_options: { publicKey: ServerCredentialRequestOptions }
1213
+ }
1214
+ }
1215
+
1216
+ /**
1217
+ * JSON-serializable version of WebAuthn challenge response.
1218
+ * Used for server communication with base64url-encoded binary fields.
1219
+ */
1220
+ export type AuthMFAChallengeWebauthnResponseDataJSON = AuthMFAChallengeResponseBase<'webauthn'> &
1221
+ AuthMFAChallengeWebauthnResponseFieldsJSON
1222
+
1223
+ /**
1224
+ * Server response type for WebAuthn MFA challenge.
1225
+ * Contains JSON-formatted WebAuthn options ready for browser API.
1226
+ */
1227
+ export type AuthMFAChallengeWebauthnServerResponse =
1228
+ RequestResult<AuthMFAChallengeWebauthnResponseDataJSON>
1229
+
1230
+ export type AuthMFAChallengeResponse =
1231
+ | AuthMFAChallengeTOTPResponse
1232
+ | AuthMFAChallengePhoneResponse
1233
+ | AuthMFAChallengeWebauthnResponse
1234
+
1235
+ /** response of ListFactors, which should contain all the types of factors that are available, this ensures we always include all */
1236
+ export type AuthMFAListFactorsResponse<T extends typeof FactorTypes = typeof FactorTypes> =
1237
+ RequestResult<
1238
+ {
1239
+ /** All available factors (verified and unverified). */
1240
+ all: Factor[]
1241
+
1242
+ // Dynamically create a property for each factor type with only verified factors
1243
+ } & {
1244
+ [K in T[number]]: Factor<K, 'verified'>[]
1245
+ }
1246
+ >
1247
+
1248
+ export type AuthenticatorAssuranceLevels = 'aal1' | 'aal2' | (string & {})
1249
+
1250
+ export type AuthMFAGetAuthenticatorAssuranceLevelResponse = RequestResult<{
1251
+ /** Current AAL level of the session. */
1252
+ currentLevel: AuthenticatorAssuranceLevels | null
1253
+
1254
+ /**
1255
+ * Next possible AAL level for the session. If the next level is higher
1256
+ * than the current one, the user should go through MFA.
1257
+ *
1258
+ * @see {@link GoTrueMFAApi#challenge}
1259
+ */
1260
+ nextLevel: AuthenticatorAssuranceLevels | null
1261
+
1262
+ /**
1263
+ * A list of all authentication methods attached to this session. Use
1264
+ * the information here to detect the last time a user verified a
1265
+ * factor, for example if implementing a step-up scenario.
1266
+ *
1267
+ * Supports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).
1268
+ * - String format: ['password', 'otp'] - RFC-8176 compliant
1269
+ * - Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps
1270
+ */
1271
+ currentAuthenticationMethods: AMREntry[] | string[]
1272
+ }>
1273
+
1274
+ /**
1275
+ * Contains the full multi-factor authentication API.
1276
+ *
1277
+ */
1278
+ export interface GoTrueMFAApi {
1279
+ /**
1280
+ * Starts the enrollment process for a new Multi-Factor Authentication (MFA)
1281
+ * factor. This method creates a new `unverified` factor.
1282
+ * To verify a factor, present the QR code or secret to the user and ask them to add it to their
1283
+ * authenticator app.
1284
+ * The user has to enter the code from their authenticator app to verify it.
1285
+ *
1286
+ * Upon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.
1287
+ *
1288
+ * @category Auth
1289
+ * @subcategory Auth MFA
1290
+ *
1291
+ * @remarks
1292
+ * - Use `totp` or `phone` as the `factorType` and use the returned `id` to create a challenge.
1293
+ * - To create a challenge, see [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge).
1294
+ * - To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).
1295
+ * - To create and verify a TOTP challenge in a single step, see [`mfa.challengeAndVerify()`](/docs/reference/javascript/auth-mfa-challengeandverify).
1296
+ * - To generate a QR code for the `totp` secret in Next.js, you can do the following:
1297
+ * ```html
1298
+ * <Image src={data.totp.qr_code} alt={data.totp.uri} layout="fill"></Image>
1299
+ * ```
1300
+ * - The `challenge` and `verify` steps are separated when using Phone factors as the user will need time to receive and input the code obtained from the SMS in challenge.
1301
+ *
1302
+ * @example Enroll a time-based, one-time password (TOTP) factor
1303
+ * ```js
1304
+ * const { data, error } = await supabase.auth.mfa.enroll({
1305
+ * factorType: 'totp',
1306
+ * friendlyName: 'your_friendly_name'
1307
+ * })
1308
+ *
1309
+ * // Use the id to create a challenge.
1310
+ * // The challenge can be verified by entering the code generated from the authenticator app.
1311
+ * // The code will be generated upon scanning the qr_code or entering the secret into the authenticator app.
1312
+ * const { id, type, totp: { qr_code, secret, uri }, friendly_name } = data
1313
+ * const challenge = await supabase.auth.mfa.challenge({ factorId: id });
1314
+ * ```
1315
+ *
1316
+ * @exampleResponse Enroll a time-based, one-time password (TOTP) factor
1317
+ * ```json
1318
+ * {
1319
+ * data: {
1320
+ * id: '<ID>',
1321
+ * type: 'totp'
1322
+ * totp: {
1323
+ * qr_code: '<QR_CODE_AS_SVG_DATA>',
1324
+ * secret: '<SECRET>',
1325
+ * uri: '<URI>',
1326
+ * }
1327
+ * friendly_name?: 'Important app'
1328
+ * },
1329
+ * error: null
1330
+ * }
1331
+ * ```
1332
+ *
1333
+ * @example Enroll a Phone Factor
1334
+ * ```js
1335
+ * const { data, error } = await supabase.auth.mfa.enroll({
1336
+ * factorType: 'phone',
1337
+ * friendlyName: 'your_friendly_name',
1338
+ * phone: '+12345678',
1339
+ * })
1340
+ *
1341
+ * // Use the id to create a challenge and send an SMS with a code to the user.
1342
+ * const { id, type, friendly_name, phone } = data
1343
+ *
1344
+ * const challenge = await supabase.auth.mfa.challenge({ factorId: id });
1345
+ * ```
1346
+ *
1347
+ * @exampleResponse Enroll a Phone Factor
1348
+ * ```json
1349
+ * {
1350
+ * data: {
1351
+ * id: '<ID>',
1352
+ * type: 'phone',
1353
+ * friendly_name?: 'Important app',
1354
+ * phone: '+5787123456'
1355
+ * },
1356
+ * error: null
1357
+ * }
1358
+ * ```
1359
+ */
1360
+ enroll(params: MFAEnrollTOTPParams): Promise<AuthMFAEnrollTOTPResponse>
1361
+ enroll(params: MFAEnrollPhoneParams): Promise<AuthMFAEnrollPhoneResponse>
1362
+ enroll(params: MFAEnrollWebauthnParams): Promise<AuthMFAEnrollWebauthnResponse>
1363
+ enroll(params: MFAEnrollParams): Promise<AuthMFAEnrollResponse>
1364
+
1365
+ /**
1366
+ * Prepares a challenge used to verify that a user has access to a MFA
1367
+ * factor.
1368
+ *
1369
+ * @category Auth
1370
+ * @subcategory Auth MFA
1371
+ *
1372
+ * @remarks
1373
+ * - An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before creating a challenge.
1374
+ * - To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).
1375
+ * - A phone factor sends a code to the user upon challenge. The channel defaults to `sms` unless otherwise specified.
1376
+ *
1377
+ * @example Create a challenge for a factor
1378
+ * ```js
1379
+ * const { data, error } = await supabase.auth.mfa.challenge({
1380
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'
1381
+ * })
1382
+ * ```
1383
+ *
1384
+ * @exampleResponse Create a challenge for a factor
1385
+ * ```json
1386
+ * {
1387
+ * data: {
1388
+ * id: '<ID>',
1389
+ * type: 'totp',
1390
+ * expires_at: 1700000000
1391
+ * },
1392
+ * error: null
1393
+ * }
1394
+ * ```
1395
+ *
1396
+ * @example Create a challenge for a phone factor
1397
+ * ```js
1398
+ * const { data, error } = await supabase.auth.mfa.challenge({
1399
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1400
+ * })
1401
+ * ```
1402
+ *
1403
+ * @exampleResponse Create a challenge for a phone factor
1404
+ * ```json
1405
+ * {
1406
+ * data: {
1407
+ * id: '<ID>',
1408
+ * type: 'phone',
1409
+ * expires_at: 1700000000
1410
+ * },
1411
+ * error: null
1412
+ * }
1413
+ * ```
1414
+ *
1415
+ * @example Create a challenge for a phone factor (WhatsApp)
1416
+ * ```js
1417
+ * const { data, error } = await supabase.auth.mfa.challenge({
1418
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1419
+ * channel: 'whatsapp',
1420
+ * })
1421
+ * ```
1422
+ *
1423
+ * @exampleResponse Create a challenge for a phone factor (WhatsApp)
1424
+ * ```json
1425
+ * {
1426
+ * data: {
1427
+ * id: '<ID>',
1428
+ * expires_at: 1700000000
1429
+ * },
1430
+ * error: null
1431
+ * }
1432
+ * ```
1433
+ */
1434
+ challenge(params: MFAChallengeTOTPParams): Promise<Prettify<AuthMFAChallengeTOTPResponse>>
1435
+ challenge(params: MFAChallengePhoneParams): Promise<Prettify<AuthMFAChallengePhoneResponse>>
1436
+ challenge(params: MFAChallengeWebauthnParams): Promise<Prettify<AuthMFAChallengeWebauthnResponse>>
1437
+ challenge(params: MFAChallengeParams): Promise<AuthMFAChallengeResponse>
1438
+
1439
+ /**
1440
+ * Verifies a code against a challenge. The verification code is
1441
+ * provided by the user by entering a code seen in their authenticator app.
1442
+ *
1443
+ * @category Auth
1444
+ * @subcategory Auth MFA
1445
+ *
1446
+ * @remarks
1447
+ * - To verify a challenge, please [create a challenge](/docs/reference/javascript/auth-mfa-challenge) first.
1448
+ *
1449
+ * @example Verify a challenge for a factor
1450
+ * ```js
1451
+ * const { data, error } = await supabase.auth.mfa.verify({
1452
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1453
+ * challengeId: '4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15',
1454
+ * code: '123456'
1455
+ * })
1456
+ * ```
1457
+ *
1458
+ * @exampleResponse Verify a challenge for a factor
1459
+ * ```json
1460
+ * {
1461
+ * data: {
1462
+ * access_token: '<ACCESS_TOKEN>',
1463
+ * token_type: 'Bearer',
1464
+ * expires_in: 3600,
1465
+ * refresh_token: '<REFRESH_TOKEN>',
1466
+ * user: {
1467
+ * id: '11111111-1111-1111-1111-111111111111',
1468
+ * aud: 'authenticated',
1469
+ * role: 'authenticated',
1470
+ * email: 'example@email.com',
1471
+ * email_confirmed_at: '2024-01-01T00:00:00Z',
1472
+ * phone: '',
1473
+ * confirmation_sent_at: '2024-01-01T00:00:00Z',
1474
+ * confirmed_at: '2024-01-01T00:00:00Z',
1475
+ * last_sign_in_at: '2024-01-01T00:00:00Z',
1476
+ * app_metadata: {
1477
+ * provider: 'email',
1478
+ * providers: [
1479
+ * "email",
1480
+ * ]
1481
+ * },
1482
+ * user_metadata: {},
1483
+ * identities: [
1484
+ * {
1485
+ * "identity_id": "22222222-2222-2222-2222-222222222222",
1486
+ * "id": "11111111-1111-1111-1111-111111111111",
1487
+ * "user_id": "11111111-1111-1111-1111-111111111111",
1488
+ * "identity_data": {
1489
+ * "email": "example@email.com",
1490
+ * "email_verified": true,
1491
+ * "phone_verified": false,
1492
+ * "sub": "11111111-1111-1111-1111-111111111111"
1493
+ * },
1494
+ * "provider": "email",
1495
+ * "last_sign_in_at": "2024-01-01T00:00:00Z",
1496
+ * "created_at": "2024-01-01T00:00:00Z",
1497
+ * "updated_at": "2024-01-01T00:00:00Z",
1498
+ * "email": "email@example.com"
1499
+ * },
1500
+ * ],
1501
+ * created_at: '2024-01-01T00:00:00Z',
1502
+ * updated_at: '2024-01-01T00:00:00Z',
1503
+ * is_anonymous: false,
1504
+ * factors: [
1505
+ * "id": '<ID>',
1506
+ * "friendly_name": 'Important Auth App',
1507
+ * "factor_type": 'totp',
1508
+ * "status": 'verified',
1509
+ * "created_at": "2024-01-01T00:00:00Z",
1510
+ * "updated_at": "2024-01-01T00:00:00Z"
1511
+ * ]
1512
+ * }
1513
+ * }
1514
+ * error: null
1515
+ * }
1516
+ * ```
1517
+ */
1518
+ verify(params: MFAVerifyTOTPParams): Promise<AuthMFAVerifyResponse>
1519
+ verify(params: MFAVerifyPhoneParams): Promise<AuthMFAVerifyResponse>
1520
+ verify(params: MFAVerifyWebauthnParams): Promise<AuthMFAVerifyResponse>
1521
+ verify(params: MFAVerifyParams): Promise<AuthMFAVerifyResponse>
1522
+
1523
+ /**
1524
+ * Unenroll removes a MFA factor.
1525
+ * A user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.
1526
+ *
1527
+ * @category Auth
1528
+ * @subcategory Auth MFA
1529
+ *
1530
+ * @example Unenroll a factor
1531
+ * ```js
1532
+ * const { data, error } = await supabase.auth.mfa.unenroll({
1533
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1534
+ * })
1535
+ * ```
1536
+ *
1537
+ * @exampleResponse Unenroll a factor
1538
+ * ```json
1539
+ * {
1540
+ * data: {
1541
+ * id: '<FACTOR_ID>'
1542
+ * },
1543
+ * error: null
1544
+ * }
1545
+ * ```
1546
+ */
1547
+ unenroll(params: MFAUnenrollParams): Promise<AuthMFAUnenrollResponse>
1548
+
1549
+ /**
1550
+ * Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is
1551
+ * provided by the user by entering a code seen in their authenticator app.
1552
+ *
1553
+ * @category Auth
1554
+ * @subcategory Auth MFA
1555
+ *
1556
+ * @remarks
1557
+ * - Intended for use with only TOTP factors.
1558
+ * - An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before invoking `challengeAndVerify()`.
1559
+ * - Executes [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge) and [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify) in a single step.
1560
+ *
1561
+ * @example Create and verify a challenge for a factor
1562
+ * ```js
1563
+ * const { data, error } = await supabase.auth.mfa.challengeAndVerify({
1564
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1565
+ * code: '123456'
1566
+ * })
1567
+ * ```
1568
+ *
1569
+ * @exampleResponse Create and verify a challenge for a factor
1570
+ * ```json
1571
+ * {
1572
+ * data: {
1573
+ * access_token: '<ACCESS_TOKEN>',
1574
+ * token_type: 'Bearer',
1575
+ * expires_in: 3600,
1576
+ * refresh_token: '<REFRESH_TOKEN>',
1577
+ * user: {
1578
+ * id: '11111111-1111-1111-1111-111111111111',
1579
+ * aud: 'authenticated',
1580
+ * role: 'authenticated',
1581
+ * email: 'example@email.com',
1582
+ * email_confirmed_at: '2024-01-01T00:00:00Z',
1583
+ * phone: '',
1584
+ * confirmation_sent_at: '2024-01-01T00:00:00Z',
1585
+ * confirmed_at: '2024-01-01T00:00:00Z',
1586
+ * last_sign_in_at: '2024-01-01T00:00:00Z',
1587
+ * app_metadata: {
1588
+ * provider: 'email',
1589
+ * providers: [
1590
+ * "email",
1591
+ * ]
1592
+ * },
1593
+ * user_metadata: {},
1594
+ * identities: [
1595
+ * {
1596
+ * "identity_id": "22222222-2222-2222-2222-222222222222",
1597
+ * "id": "11111111-1111-1111-1111-111111111111",
1598
+ * "user_id": "11111111-1111-1111-1111-111111111111",
1599
+ * "identity_data": {
1600
+ * "email": "example@email.com",
1601
+ * "email_verified": true,
1602
+ * "phone_verified": false,
1603
+ * "sub": "11111111-1111-1111-1111-111111111111"
1604
+ * },
1605
+ * "provider": "email",
1606
+ * "last_sign_in_at": "2024-01-01T00:00:00Z",
1607
+ * "created_at": "2024-01-01T00:00:00Z",
1608
+ * "updated_at": "2024-01-01T00:00:00Z",
1609
+ * "email": "email@example.com"
1610
+ * },
1611
+ * ],
1612
+ * created_at: '2024-01-01T00:00:00Z',
1613
+ * updated_at: '2024-01-01T00:00:00Z',
1614
+ * is_anonymous: false,
1615
+ * factors: [
1616
+ * "id": '<ID>',
1617
+ * "friendly_name": 'Important Auth App',
1618
+ * "factor_type": 'totp',
1619
+ * "status": 'verified',
1620
+ * "created_at": "2024-01-01T00:00:00Z",
1621
+ * "updated_at": "2024-01-01T00:00:00Z"
1622
+ * ]
1623
+ * }
1624
+ * }
1625
+ * error: null
1626
+ * }
1627
+ * ```
1628
+ */
1629
+ challengeAndVerify(params: MFAChallengeAndVerifyParams): Promise<AuthMFAVerifyResponse>
1630
+
1631
+ /**
1632
+ * Returns the list of MFA factors enabled for this user.
1633
+ *
1634
+ * @see {@link GoTrueMFAApi#enroll}
1635
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}
1636
+ * @see {@link GoTrueClient#getUser}
1637
+ *
1638
+ *
1639
+ * @category Auth
1640
+ * @subcategory Auth MFA
1641
+ */
1642
+ listFactors(): Promise<AuthMFAListFactorsResponse>
1643
+
1644
+ /**
1645
+ * Returns the Authenticator Assurance Level (AAL) for the active session.
1646
+ *
1647
+ * - `aal1` (or `null`) means that the user's identity has been verified only
1648
+ * with a conventional login (email+password, OTP, magic link, social login,
1649
+ * etc.).
1650
+ * - `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.
1651
+ *
1652
+ * When called without a JWT parameter, this method is fairly quick (microseconds)
1653
+ * and rarely uses the network. When a JWT is provided (useful in server-side
1654
+ * environments like Edge Functions where no session is stored), this method
1655
+ * will make a network request to validate the user and fetch their MFA factors.
1656
+ *
1657
+ * @param jwt Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used.
1658
+ *
1659
+ * @category Auth
1660
+ * @subcategory Auth MFA
1661
+ *
1662
+ * @remarks
1663
+ * - Authenticator Assurance Level (AAL) is the measure of the strength of an authentication mechanism.
1664
+ * - In Supabase, having an AAL of `aal1` refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while `aal2` refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP) or Phone factor.
1665
+ * - If the user has a verified factor, the `nextLevel` field will return `aal2`, else, it will return `aal1`.
1666
+ * - An optional `jwt` parameter can be passed to check the AAL level of a specific JWT instead of the current session.
1667
+ *
1668
+ * @example Get the AAL details of a session
1669
+ * ```js
1670
+ * const { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()
1671
+ * const { currentLevel, nextLevel, currentAuthenticationMethods } = data
1672
+ * ```
1673
+ *
1674
+ * @exampleResponse Get the AAL details of a session
1675
+ * ```json
1676
+ * {
1677
+ * data: {
1678
+ * currentLevel: 'aal1',
1679
+ * nextLevel: 'aal2',
1680
+ * currentAuthenticationMethods: [
1681
+ * {
1682
+ * method: 'password',
1683
+ * timestamp: 1700000000
1684
+ * }
1685
+ * ]
1686
+ * }
1687
+ * error: null
1688
+ * }
1689
+ * ```
1690
+ *
1691
+ * @example Get the AAL details for a specific JWT
1692
+ * ```js
1693
+ * const { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel(jwt)
1694
+ * ```
1695
+ */
1696
+ getAuthenticatorAssuranceLevel(
1697
+ jwt?: string
1698
+ ): Promise<AuthMFAGetAuthenticatorAssuranceLevelResponse>
1699
+
1700
+ // namespace for the webauthn methods
1701
+ webauthn: WebAuthnApi
1702
+ }
1703
+
1704
+ /**
1705
+ * @expermental
1706
+ */
1707
+ export type AuthMFAAdminDeleteFactorResponse = RequestResult<{
1708
+ /** ID of the factor that was successfully deleted. */
1709
+ id: string
1710
+ }>
1711
+ /**
1712
+ * @expermental
1713
+ */
1714
+ export type AuthMFAAdminDeleteFactorParams = {
1715
+ /** ID of the MFA factor to delete. */
1716
+ id: string
1717
+
1718
+ /** ID of the user whose factor is being deleted. */
1719
+ userId: string
1720
+ }
1721
+
1722
+ /**
1723
+ * @expermental
1724
+ */
1725
+ export type AuthMFAAdminListFactorsResponse = RequestResult<{
1726
+ /** All factors attached to the user. */
1727
+ factors: Factor[]
1728
+ }>
1729
+
1730
+ /**
1731
+ * @expermental
1732
+ */
1733
+ export type AuthMFAAdminListFactorsParams = {
1734
+ /** ID of the user. */
1735
+ userId: string
1736
+ }
1737
+
1738
+ /**
1739
+ * Contains the full multi-factor authentication administration API.
1740
+ *
1741
+ * @expermental
1742
+ */
1743
+ export interface GoTrueAdminMFAApi {
1744
+ /**
1745
+ * Lists all factors associated to a user.
1746
+ *
1747
+ *
1748
+ * @category Auth
1749
+ * @subcategory Auth Admin
1750
+ *
1751
+ * @example List all factors for a user
1752
+ * ```js
1753
+ * const { data, error } = await supabase.auth.admin.mfa.listFactors()
1754
+ * ```
1755
+ *
1756
+ * @exampleResponse List all factors for a user
1757
+ * ```json
1758
+ * {
1759
+ * data: {
1760
+ * factors: Factor[
1761
+ * {
1762
+ * id: '<ID>',
1763
+ * friendly_name: 'Auth App Factor',
1764
+ * factor_type: 'totp',
1765
+ * status: 'verified',
1766
+ * created_at: '2024-01-01T00:00:00Z',
1767
+ * updated_at: '2024-01-01T00:00:00Z'
1768
+ * }
1769
+ * ]
1770
+ * },
1771
+ * error: null
1772
+ * }
1773
+ * ```
1774
+ */
1775
+ listFactors(params: AuthMFAAdminListFactorsParams): Promise<AuthMFAAdminListFactorsResponse>
1776
+
1777
+ /**
1778
+ * Deletes a factor on a user. This will log the user out of all active
1779
+ * sessions if the deleted factor was verified.
1780
+ *
1781
+ * @see {@link GoTrueMFAApi#unenroll}
1782
+ *
1783
+ * @expermental
1784
+ *
1785
+ * @category Auth
1786
+ * @subcategory Auth Admin
1787
+ *
1788
+ * @example Delete a factor for a user
1789
+ * ```js
1790
+ * const { data, error } = await supabase.auth.admin.mfa.deleteFactor({
1791
+ * id: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1792
+ * userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b',
1793
+ * })
1794
+ * ```
1795
+ *
1796
+ * @exampleResponse Delete a factor for a user
1797
+ * ```json
1798
+ * {
1799
+ * data: {
1800
+ * id: '34e770dd-9ff9-416c-87fa-43b31d7ef225'
1801
+ * },
1802
+ * error: null
1803
+ * }
1804
+ * ```
1805
+ */
1806
+ deleteFactor(params: AuthMFAAdminDeleteFactorParams): Promise<AuthMFAAdminDeleteFactorResponse>
1807
+ }
1808
+
1809
+ type AnyFunction = (...args: any[]) => any
1810
+ type MaybePromisify<T> = T | Promise<T>
1811
+
1812
+ type PromisifyMethods<T> = {
1813
+ [K in keyof T]: T[K] extends AnyFunction
1814
+ ? (...args: Parameters<T[K]>) => MaybePromisify<ReturnType<T[K]>>
1815
+ : T[K]
1816
+ }
1817
+
1818
+ export type SupportedStorage = PromisifyMethods<
1819
+ Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>
1820
+ > & {
1821
+ /**
1822
+ * If set to `true` signals to the library that the storage medium is used
1823
+ * on a server and the values may not be authentic, such as reading from
1824
+ * request cookies. Implementations should not set this to true if the client
1825
+ * is used on a server that reads storage information from authenticated
1826
+ * sources, such as a secure database or file.
1827
+ */
1828
+ isServer?: boolean
1829
+ }
1830
+
1831
+ export type InitializeResult = { error: AuthError | null }
1832
+
1833
+ export type CallRefreshTokenResult = RequestResult<Session>
1834
+
1835
+ export type Pagination = {
1836
+ [key: string]: any
1837
+ nextPage: number | null
1838
+ lastPage: number
1839
+ total: number
1840
+ }
1841
+
1842
+ export type PageParams = {
1843
+ /** The page number */
1844
+ page?: number
1845
+ /** Number of items returned per page */
1846
+ perPage?: number
1847
+ }
1848
+
1849
+ export type SignOut = {
1850
+ /**
1851
+ * Determines which sessions should be
1852
+ * logged out. Global means all
1853
+ * sessions by this account. Local
1854
+ * means only this session. Others
1855
+ * means all other sessions except the
1856
+ * current one. When using others,
1857
+ * there is no sign-out event fired on
1858
+ * the current session!
1859
+ */
1860
+ scope?: 'global' | 'local' | 'others'
1861
+ }
1862
+
1863
+ type MFAEnrollParamsBase<T extends FactorType> = {
1864
+ /** The type of factor being enrolled. */
1865
+ factorType: T
1866
+ /** Human readable name assigned to the factor. */
1867
+ friendlyName?: string
1868
+ }
1869
+
1870
+ type MFAEnrollTOTPParamFields = {
1871
+ /** Domain which the user is enrolled with. */
1872
+ issuer?: string
1873
+ }
1874
+
1875
+ export type MFAEnrollTOTPParams = MFAEnrollParamsBase<'totp'> & MFAEnrollTOTPParamFields
1876
+
1877
+ type MFAEnrollPhoneParamFields = {
1878
+ /** Phone number associated with a factor. Number should conform to E.164 format */
1879
+ phone: string
1880
+ }
1881
+ export type MFAEnrollPhoneParams = MFAEnrollParamsBase<'phone'> & MFAEnrollPhoneParamFields
1882
+
1883
+ type MFAEnrollWebauthnFields = {
1884
+ /** no extra fields for now, kept for consistency and for possible future changes */
1885
+ }
1886
+
1887
+ /**
1888
+ * Parameters for enrolling a WebAuthn factor.
1889
+ * Creates an unverified WebAuthn factor that must be verified with a credential.
1890
+ * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
1891
+ */
1892
+ export type MFAEnrollWebauthnParams = MFAEnrollParamsBase<'webauthn'> & MFAEnrollWebauthnFields
1893
+
1894
+ type AuthMFAEnrollResponseBase<T extends FactorType> = {
1895
+ /** ID of the factor that was just enrolled (in an unverified state). */
1896
+ id: string
1897
+
1898
+ /** Type of MFA factor.*/
1899
+ type: T
1900
+
1901
+ /** Friendly name of the factor, useful for distinguishing between factors **/
1902
+ friendly_name?: string
1903
+ }
1904
+
1905
+ type AuthMFAEnrollTOTPResponseFields = {
1906
+ /** TOTP enrollment information. */
1907
+ totp: {
1908
+ /** Contains a QR code encoding the authenticator URI. You can
1909
+ * convert it to a URL by prepending `data:image/svg+xml;utf-8,` to
1910
+ * the value. Avoid logging this value to the console. */
1911
+ qr_code: string
1912
+
1913
+ /** The TOTP secret (also encoded in the QR code). Show this secret
1914
+ * in a password-style field to the user, in case they are unable to
1915
+ * scan the QR code. Avoid logging this value to the console. */
1916
+ secret: string
1917
+
1918
+ /** The authenticator URI encoded within the QR code, should you need
1919
+ * to use it. Avoid loggin this value to the console. */
1920
+ uri: string
1921
+ }
1922
+ }
1923
+
1924
+ export type AuthMFAEnrollTOTPResponse = RequestResult<
1925
+ AuthMFAEnrollResponseBase<'totp'> & AuthMFAEnrollTOTPResponseFields
1926
+ >
1927
+
1928
+ type AuthMFAEnrollPhoneResponseFields = {
1929
+ /** Phone number of the MFA factor in E.164 format. Used to send messages */
1930
+ phone: string
1931
+ }
1932
+
1933
+ export type AuthMFAEnrollPhoneResponse = RequestResult<
1934
+ AuthMFAEnrollResponseBase<'phone'> & AuthMFAEnrollPhoneResponseFields
1935
+ >
1936
+
1937
+ type AuthMFAEnrollWebauthnFields = {
1938
+ /** no extra fields for now, kept for consistency and for possible future changes */
1939
+ }
1940
+
1941
+ /**
1942
+ * Response type for WebAuthn factor enrollment.
1943
+ * Returns the enrolled factor ID and metadata.
1944
+ * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
1945
+ */
1946
+ export type AuthMFAEnrollWebauthnResponse = RequestResult<
1947
+ AuthMFAEnrollResponseBase<'webauthn'> & AuthMFAEnrollWebauthnFields
1948
+ >
1949
+
1950
+ export type JwtHeader = {
1951
+ alg: 'RS256' | 'ES256' | 'HS256' | (string & {})
1952
+ kid: string
1953
+ typ: string
1954
+ }
1955
+
1956
+ export type RequiredClaims = {
1957
+ iss: string
1958
+ sub: string
1959
+ aud: string | string[]
1960
+ exp: number
1961
+ iat: number
1962
+ role: string
1963
+ aal: AuthenticatorAssuranceLevels
1964
+ session_id: string
1965
+ }
1966
+
1967
+ /**
1968
+ * JWT Payload containing claims for Supabase authentication tokens.
1969
+ *
1970
+ * Required claims (iss, aud, exp, iat, sub, role, aal, session_id) are inherited from RequiredClaims.
1971
+ * All other claims are optional as they can be customized via Custom Access Token Hooks.
1972
+ *
1973
+ * @see https://supabase.com/docs/guides/auth/jwt-fields
1974
+ */
1975
+ export interface JwtPayload extends RequiredClaims {
1976
+ // Standard optional claims (can be customized via custom access token hooks)
1977
+ email?: string
1978
+ phone?: string
1979
+ is_anonymous?: boolean
1980
+
1981
+ // Optional claims
1982
+ jti?: string
1983
+ nbf?: number
1984
+ app_metadata?: UserAppMetadata
1985
+ user_metadata?: UserMetadata
1986
+ /**
1987
+ * Authentication Method References.
1988
+ * Supports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).
1989
+ * - String format: ['password', 'otp'] - RFC-8176 compliant
1990
+ * - Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps
1991
+ */
1992
+ amr?: AMREntry[] | string[]
1993
+
1994
+ // Special claims (only in anon/service role tokens)
1995
+ ref?: string
1996
+
1997
+ // Allow custom claims via custom access token hooks
1998
+ [key: string]: any
1999
+ }
2000
+
2001
+ export interface JWK {
2002
+ kty: 'RSA' | 'EC' | 'oct' | (string & {})
2003
+ key_ops: string[]
2004
+ alg?: string
2005
+ kid?: string
2006
+ [key: string]: any
2007
+ }
2008
+
2009
+ export const SIGN_OUT_SCOPES = ['global', 'local', 'others'] as const
2010
+ export type SignOutScope = (typeof SIGN_OUT_SCOPES)[number]
2011
+
2012
+ /**
2013
+ * OAuth client grant types supported by the OAuth 2.1 server.
2014
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2015
+ */
2016
+ export type OAuthClientGrantType = 'authorization_code' | 'refresh_token' | (string & {})
2017
+
2018
+ /**
2019
+ * OAuth client response types supported by the OAuth 2.1 server.
2020
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2021
+ */
2022
+ export type OAuthClientResponseType = 'code'
2023
+
2024
+ /**
2025
+ * OAuth client type indicating whether the client can keep credentials confidential.
2026
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2027
+ */
2028
+ export type OAuthClientType = 'public' | 'confidential'
2029
+
2030
+ /**
2031
+ * OAuth client registration type.
2032
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2033
+ */
2034
+ export type OAuthClientRegistrationType = 'dynamic' | 'manual'
2035
+
2036
+ /**
2037
+ * OAuth client token endpoint authentication method.
2038
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2039
+ */
2040
+ export type OAuthClientTokenEndpointAuthMethod =
2041
+ | 'none'
2042
+ | 'client_secret_basic'
2043
+ | 'client_secret_post'
2044
+
2045
+ /**
2046
+ * OAuth client object returned from the OAuth 2.1 server.
2047
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2048
+ */
2049
+ export type OAuthClient = {
2050
+ /** Unique identifier for the OAuth client */
2051
+ client_id: string
2052
+ /** Human-readable name of the OAuth client */
2053
+ client_name: string
2054
+ /** Client secret (only returned on registration and regeneration) */
2055
+ client_secret?: string
2056
+ /** Type of OAuth client */
2057
+ client_type: OAuthClientType
2058
+ /** Token endpoint authentication method */
2059
+ token_endpoint_auth_method: OAuthClientTokenEndpointAuthMethod
2060
+ /** Registration type of the client */
2061
+ registration_type: OAuthClientRegistrationType
2062
+ /** URI of the OAuth client */
2063
+ client_uri?: string
2064
+ /** URI of the OAuth client's logo */
2065
+ logo_uri?: string
2066
+ /** Array of allowed redirect URIs */
2067
+ redirect_uris: string[]
2068
+ /** Array of allowed grant types */
2069
+ grant_types: OAuthClientGrantType[]
2070
+ /** Array of allowed response types */
2071
+ response_types: OAuthClientResponseType[]
2072
+ /** Scope of the OAuth client */
2073
+ scope?: string
2074
+ /** Timestamp when the client was created */
2075
+ created_at: string
2076
+ /** Timestamp when the client was last updated */
2077
+ updated_at: string
2078
+ }
2079
+
2080
+ /**
2081
+ * Parameters for creating a new OAuth client.
2082
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2083
+ */
2084
+ export type CreateOAuthClientParams = {
2085
+ /** Human-readable name of the OAuth client */
2086
+ client_name: string
2087
+ /** URI of the OAuth client */
2088
+ client_uri?: string
2089
+ /** Array of allowed redirect URIs */
2090
+ redirect_uris: string[]
2091
+ /** Array of allowed grant types (optional, defaults to authorization_code and refresh_token) */
2092
+ grant_types?: OAuthClientGrantType[]
2093
+ /** Array of allowed response types (optional, defaults to code) */
2094
+ response_types?: OAuthClientResponseType[]
2095
+ /** Scope of the OAuth client */
2096
+ scope?: string
2097
+ /** Token endpoint authentication method (defaults to server default if not specified) */
2098
+ token_endpoint_auth_method?: OAuthClientTokenEndpointAuthMethod
2099
+ }
2100
+
2101
+ /**
2102
+ * Parameters for updating an existing OAuth client.
2103
+ * All fields are optional. Only provided fields will be updated.
2104
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2105
+ */
2106
+ export type UpdateOAuthClientParams = {
2107
+ /** Human-readable name of the OAuth client */
2108
+ client_name?: string
2109
+ /** URI of the OAuth client */
2110
+ client_uri?: string
2111
+ /** URI of the OAuth client's logo */
2112
+ logo_uri?: string
2113
+ /** Array of allowed redirect URIs */
2114
+ redirect_uris?: string[]
2115
+ /** Array of allowed grant types */
2116
+ grant_types?: OAuthClientGrantType[]
2117
+ /** Token endpoint authentication method */
2118
+ token_endpoint_auth_method?: OAuthClientTokenEndpointAuthMethod
2119
+ }
2120
+
2121
+ /**
2122
+ * Response type for OAuth client operations.
2123
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2124
+ */
2125
+ export type OAuthClientResponse = RequestResult<OAuthClient>
2126
+
2127
+ /**
2128
+ * Response type for listing OAuth clients.
2129
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2130
+ */
2131
+ export type OAuthClientListResponse =
2132
+ | {
2133
+ data: { clients: OAuthClient[]; aud: string } & Pagination
2134
+ error: null
2135
+ }
2136
+ | {
2137
+ data: { clients: [] }
2138
+ error: AuthError
2139
+ }
2140
+
2141
+ /**
2142
+ * Contains all OAuth client administration methods.
2143
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2144
+ */
2145
+ export interface GoTrueAdminOAuthApi {
2146
+ /**
2147
+ * Lists all OAuth clients with optional pagination.
2148
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2149
+ *
2150
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2151
+ *
2152
+ * @category Auth
2153
+ * @subcategory OAuth Admin
2154
+ */
2155
+ listClients(params?: PageParams): Promise<OAuthClientListResponse>
2156
+
2157
+ /**
2158
+ * Creates a new OAuth client.
2159
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2160
+ *
2161
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2162
+ *
2163
+ * @category Auth
2164
+ * @subcategory OAuth Admin
2165
+ */
2166
+ createClient(params: CreateOAuthClientParams): Promise<OAuthClientResponse>
2167
+
2168
+ /**
2169
+ * Gets details of a specific OAuth client.
2170
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2171
+ *
2172
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2173
+ *
2174
+ * @category Auth
2175
+ * @subcategory OAuth Admin
2176
+ */
2177
+ getClient(clientId: string): Promise<OAuthClientResponse>
2178
+
2179
+ /**
2180
+ * Updates an existing OAuth client.
2181
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2182
+ *
2183
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2184
+ *
2185
+ * @category Auth
2186
+ * @subcategory OAuth Admin
2187
+ */
2188
+ updateClient(clientId: string, params: UpdateOAuthClientParams): Promise<OAuthClientResponse>
2189
+
2190
+ /**
2191
+ * Deletes an OAuth client.
2192
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2193
+ *
2194
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2195
+ *
2196
+ * @category Auth
2197
+ * @subcategory OAuth Admin
2198
+ */
2199
+ deleteClient(clientId: string): Promise<{ data: null; error: AuthError | null }>
2200
+
2201
+ /**
2202
+ * Regenerates the secret for an OAuth client.
2203
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2204
+ *
2205
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2206
+ *
2207
+ * @category Auth
2208
+ * @subcategory OAuth Admin
2209
+ */
2210
+ regenerateClientSecret(clientId: string): Promise<OAuthClientResponse>
2211
+ }
2212
+
2213
+ /**
2214
+ * Type of custom identity provider.
2215
+ */
2216
+ export type CustomProviderType = 'oauth2' | 'oidc'
2217
+
2218
+ /**
2219
+ * OIDC discovery document fields.
2220
+ * Populated when the server successfully fetches and validates the
2221
+ * provider's OpenID Connect discovery document.
2222
+ */
2223
+ export type OIDCDiscoveryDocument = {
2224
+ /** The issuer identifier */
2225
+ issuer: string
2226
+ /** URL of the authorization endpoint */
2227
+ authorization_endpoint: string
2228
+ /** URL of the token endpoint */
2229
+ token_endpoint: string
2230
+ /** URL of the JSON Web Key Set */
2231
+ jwks_uri: string
2232
+ /** URL of the userinfo endpoint */
2233
+ userinfo_endpoint?: string
2234
+ /** URL of the revocation endpoint */
2235
+ revocation_endpoint?: string
2236
+ /** List of supported scopes */
2237
+ supported_scopes?: string[]
2238
+ /** List of supported response types */
2239
+ supported_response_types?: string[]
2240
+ /** List of supported subject types */
2241
+ supported_subject_types?: string[]
2242
+ /** List of supported ID token signing algorithms */
2243
+ supported_id_token_signing_algs?: string[]
2244
+ }
2245
+
2246
+ /**
2247
+ * Custom OAuth/OIDC provider object returned from the admin API.
2248
+ */
2249
+ export type CustomOAuthProvider = {
2250
+ /** Unique identifier (UUID) */
2251
+ id: string
2252
+ /** Provider type */
2253
+ provider_type: CustomProviderType
2254
+ /** Provider identifier (e.g. `custom:mycompany`) */
2255
+ identifier: string
2256
+ /** Human-readable name */
2257
+ name: string
2258
+ /** OAuth client ID */
2259
+ client_id: string
2260
+ /** Additional client IDs accepted during token validation */
2261
+ acceptable_client_ids?: string[]
2262
+ /** OAuth scopes requested during authorization */
2263
+ scopes?: string[]
2264
+ /** Whether PKCE is enabled */
2265
+ pkce_enabled?: boolean
2266
+ /** Mapping of provider attributes to Supabase user attributes */
2267
+ attribute_mapping?: Record<string, any>
2268
+ /** Additional parameters sent with the authorization request */
2269
+ authorization_params?: Record<string, string>
2270
+ /** Whether the provider is enabled */
2271
+ enabled?: boolean
2272
+ /** Whether email is optional for this provider */
2273
+ email_optional?: boolean
2274
+ /** OIDC issuer URL */
2275
+ issuer?: string
2276
+ /** OIDC discovery URL */
2277
+ discovery_url?: string
2278
+ /** Whether to skip nonce check (OIDC) */
2279
+ skip_nonce_check?: boolean
2280
+ /** OAuth2 authorization URL */
2281
+ authorization_url?: string
2282
+ /** OAuth2 token URL */
2283
+ token_url?: string
2284
+ /** OAuth2 userinfo URL */
2285
+ userinfo_url?: string
2286
+ /** JWKS URI for token verification */
2287
+ jwks_uri?: string
2288
+ /** OIDC discovery document (OIDC providers only) */
2289
+ discovery_document?: OIDCDiscoveryDocument | null
2290
+ /** Timestamp when the provider was created */
2291
+ created_at: string
2292
+ /** Timestamp when the provider was last updated */
2293
+ updated_at: string
2294
+ }
2295
+
2296
+ /**
2297
+ * Parameters for creating a new custom provider.
2298
+ */
2299
+ export type CreateCustomProviderParams = {
2300
+ /** Provider type */
2301
+ provider_type: CustomProviderType
2302
+ /** Provider identifier (e.g. `custom:mycompany`) */
2303
+ identifier: string
2304
+ /** Human-readable name */
2305
+ name: string
2306
+ /** OAuth client ID */
2307
+ client_id: string
2308
+ /** OAuth client secret (write-only, not returned in responses) */
2309
+ client_secret: string
2310
+ /** Additional client IDs accepted during token validation */
2311
+ acceptable_client_ids?: string[]
2312
+ /** OAuth scopes requested during authorization */
2313
+ scopes?: string[]
2314
+ /** Whether PKCE is enabled */
2315
+ pkce_enabled?: boolean
2316
+ /** Mapping of provider attributes to Supabase user attributes */
2317
+ attribute_mapping?: Record<string, any>
2318
+ /** Additional parameters sent with the authorization request */
2319
+ authorization_params?: Record<string, string>
2320
+ /** Whether the provider is enabled */
2321
+ enabled?: boolean
2322
+ /** Whether email is optional for this provider */
2323
+ email_optional?: boolean
2324
+ /** OIDC issuer URL */
2325
+ issuer?: string
2326
+ /** OIDC discovery URL */
2327
+ discovery_url?: string
2328
+ /** Whether to skip nonce check (OIDC) */
2329
+ skip_nonce_check?: boolean
2330
+ /** OAuth2 authorization URL */
2331
+ authorization_url?: string
2332
+ /** OAuth2 token URL */
2333
+ token_url?: string
2334
+ /** OAuth2 userinfo URL */
2335
+ userinfo_url?: string
2336
+ /** JWKS URI for token verification */
2337
+ jwks_uri?: string
2338
+ }
2339
+
2340
+ /**
2341
+ * Parameters for updating an existing custom provider.
2342
+ * All fields are optional. Only provided fields will be updated.
2343
+ * `provider_type` and `identifier` are immutable and cannot be changed.
2344
+ */
2345
+ export type UpdateCustomProviderParams = {
2346
+ /** Human-readable name */
2347
+ name?: string
2348
+ /** OAuth client ID */
2349
+ client_id?: string
2350
+ /** OAuth client secret (write-only, not returned in responses) */
2351
+ client_secret?: string
2352
+ /** Additional client IDs accepted during token validation */
2353
+ acceptable_client_ids?: string[]
2354
+ /** OAuth scopes requested during authorization */
2355
+ scopes?: string[]
2356
+ /** Whether PKCE is enabled */
2357
+ pkce_enabled?: boolean
2358
+ /** Mapping of provider attributes to Supabase user attributes */
2359
+ attribute_mapping?: Record<string, any>
2360
+ /** Additional parameters sent with the authorization request */
2361
+ authorization_params?: Record<string, string>
2362
+ /** Whether the provider is enabled */
2363
+ enabled?: boolean
2364
+ /** Whether email is optional for this provider */
2365
+ email_optional?: boolean
2366
+ /** OIDC issuer URL */
2367
+ issuer?: string
2368
+ /** OIDC discovery URL */
2369
+ discovery_url?: string
2370
+ /** Whether to skip nonce check (OIDC) */
2371
+ skip_nonce_check?: boolean
2372
+ /** OAuth2 authorization URL */
2373
+ authorization_url?: string
2374
+ /** OAuth2 token URL */
2375
+ token_url?: string
2376
+ /** OAuth2 userinfo URL */
2377
+ userinfo_url?: string
2378
+ /** JWKS URI for token verification */
2379
+ jwks_uri?: string
2380
+ }
2381
+
2382
+ /**
2383
+ * Parameters for listing custom providers.
2384
+ */
2385
+ export type ListCustomProvidersParams = {
2386
+ /** Filter by provider type */
2387
+ type?: CustomProviderType
2388
+ }
2389
+
2390
+ /**
2391
+ * Response type for custom provider operations.
2392
+ */
2393
+ export type CustomProviderResponse = RequestResult<CustomOAuthProvider>
2394
+
2395
+ /**
2396
+ * Response type for listing custom providers.
2397
+ */
2398
+ export type CustomProviderListResponse =
2399
+ | {
2400
+ data: { providers: CustomOAuthProvider[] }
2401
+ error: null
2402
+ }
2403
+ | {
2404
+ data: { providers: [] }
2405
+ error: AuthError
2406
+ }
2407
+
2408
+ /**
2409
+ * Contains all custom OIDC/OAuth provider administration methods.
2410
+ */
2411
+ export interface GoTrueAdminCustomProvidersApi {
2412
+ /**
2413
+ * Lists all custom providers with optional type filter.
2414
+ *
2415
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2416
+ *
2417
+ * @category Auth
2418
+ * @subcategory Auth Admin
2419
+ */
2420
+ listProviders(params?: ListCustomProvidersParams): Promise<CustomProviderListResponse>
2421
+
2422
+ /**
2423
+ * Creates a new custom OIDC/OAuth provider.
2424
+ *
2425
+ * For OIDC providers, the server fetches and validates the OpenID Connect discovery document
2426
+ * from the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.
2427
+ * This may return a validation error (`error_code: "validation_failed"`) if the discovery
2428
+ * document is unreachable, not valid JSON, missing required fields, or if the issuer
2429
+ * in the document does not match the expected issuer.
2430
+ *
2431
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2432
+ *
2433
+ * @category Auth
2434
+ * @subcategory Auth Admin
2435
+ */
2436
+ createProvider(params: CreateCustomProviderParams): Promise<CustomProviderResponse>
2437
+
2438
+ /**
2439
+ * Gets details of a specific custom provider by identifier.
2440
+ *
2441
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2442
+ *
2443
+ * @category Auth
2444
+ * @subcategory Auth Admin
2445
+ */
2446
+ getProvider(identifier: string): Promise<CustomProviderResponse>
2447
+
2448
+ /**
2449
+ * Updates an existing custom provider.
2450
+ *
2451
+ * When `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and
2452
+ * validates the discovery document before persisting. This may return a validation error
2453
+ * (`error_code: "validation_failed"`) if the discovery document is unreachable, invalid, or
2454
+ * the issuer does not match.
2455
+ *
2456
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2457
+ *
2458
+ * @category Auth
2459
+ * @subcategory Auth Admin
2460
+ */
2461
+ updateProvider(
2462
+ identifier: string,
2463
+ params: UpdateCustomProviderParams
2464
+ ): Promise<CustomProviderResponse>
2465
+
2466
+ /**
2467
+ * Deletes a custom provider.
2468
+ *
2469
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2470
+ *
2471
+ * @category Auth
2472
+ * @subcategory Auth Admin
2473
+ */
2474
+ deleteProvider(identifier: string): Promise<{ data: null; error: AuthError | null }>
2475
+ }
2476
+
2477
+ /**
2478
+ * OAuth client details in an authorization request.
2479
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2480
+ */
2481
+ export type OAuthAuthorizationClient = {
2482
+ /** Unique identifier for the OAuth client (UUID) */
2483
+ id: string
2484
+ /** Human-readable name of the OAuth client */
2485
+ name: string
2486
+ /** URI of the OAuth client's website */
2487
+ uri: string
2488
+ /** URI of the OAuth client's logo */
2489
+ logo_uri: string
2490
+ }
2491
+
2492
+ /**
2493
+ * OAuth authorization details when user needs to provide consent.
2494
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2495
+ *
2496
+ * This response includes all information needed to display a consent page:
2497
+ * client details, user info, requested scopes, and where the user will be redirected.
2498
+ *
2499
+ * Note: `redirect_uri` is the base URI (e.g., "https://app.com/callback") without
2500
+ * query parameters. After consent, you'll receive a complete `redirect_url` with
2501
+ * the authorization code and state parameters appended.
2502
+ */
2503
+ export type OAuthAuthorizationDetails = {
2504
+ /** The authorization ID used to approve or deny the request */
2505
+ authorization_id: string
2506
+ /** The OAuth client's registered redirect URI (base URI without query parameters) */
2507
+ redirect_uri: string
2508
+ /** OAuth client requesting authorization */
2509
+ client: OAuthAuthorizationClient
2510
+ /** User object associated with the authorization */
2511
+ user: {
2512
+ /** User ID (UUID) */
2513
+ id: string
2514
+ /** User email */
2515
+ email: string
2516
+ }
2517
+ /** Space-separated list of requested scopes (e.g., "openid profile email") */
2518
+ scope: string
2519
+ }
2520
+
2521
+ /**
2522
+ * OAuth redirect response when user has already consented or after consent decision.
2523
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2524
+ *
2525
+ * This response is returned in three scenarios:
2526
+ * 1. User already consented to these scopes (auto-approved)
2527
+ * 2. User just approved the authorization request
2528
+ * 3. User just denied the authorization request
2529
+ *
2530
+ * The `redirect_url` is a complete URL ready for redirecting the user back to the
2531
+ * OAuth client, including authorization code (on success) or error (on denial) in
2532
+ * query parameters, along with the state parameter if one was provided.
2533
+ */
2534
+ export type OAuthRedirect = {
2535
+ /** Complete redirect URL with authorization code and state parameters (e.g., "https://app.com/callback?code=xxx&state=yyy") */
2536
+ redirect_url: string
2537
+ }
2538
+
2539
+ /**
2540
+ * Response type for getting OAuth authorization details.
2541
+ * Returns either full authorization details (if consent needed) or redirect URL (if already consented).
2542
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2543
+ *
2544
+ * @example
2545
+ * ```typescript
2546
+ * const { data, error } = await supabase.auth.oauth.getAuthorizationDetails(authorizationId)
2547
+ *
2548
+ * if (error) {
2549
+ * console.error('Error:', error)
2550
+ * } else if ('authorization_id' in data) {
2551
+ * // User needs to provide consent - show consent page
2552
+ * console.log('Client:', data.client.name)
2553
+ * console.log('Scopes:', data.scope)
2554
+ * console.log('Redirect URI:', data.redirect_uri)
2555
+ * } else {
2556
+ * // User already consented - redirect immediately
2557
+ * window.location.href = data.redirect_url
2558
+ * }
2559
+ * ```
2560
+ */
2561
+ export type AuthOAuthAuthorizationDetailsResponse = RequestResult<
2562
+ OAuthAuthorizationDetails | OAuthRedirect
2563
+ >
2564
+
2565
+ /**
2566
+ * Response type for OAuth consent decision (approve/deny).
2567
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2568
+ */
2569
+ export type AuthOAuthConsentResponse = RequestResult<OAuthRedirect>
2570
+
2571
+ /**
2572
+ * An OAuth grant representing a user's authorization of an OAuth client.
2573
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2574
+ */
2575
+ export type OAuthGrant = {
2576
+ /** OAuth client information */
2577
+ client: OAuthAuthorizationClient
2578
+ /** Array of scopes granted to this client */
2579
+ scopes: string[]
2580
+ /** Timestamp when the grant was created (ISO 8601 date-time) */
2581
+ granted_at: string
2582
+ }
2583
+
2584
+ /**
2585
+ * Response type for listing user's OAuth grants.
2586
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2587
+ */
2588
+ export type AuthOAuthGrantsResponse = RequestResult<OAuthGrant[]>
2589
+
2590
+ /**
2591
+ * Response type for revoking an OAuth grant.
2592
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2593
+ */
2594
+ export type AuthOAuthRevokeGrantResponse = RequestResult<{}>
2595
+
2596
+ /**
2597
+ * Contains all OAuth 2.1 authorization server user-facing methods.
2598
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2599
+ *
2600
+ * These methods are used to implement the consent page.
2601
+ */
2602
+ export interface AuthOAuthServerApi {
2603
+ /**
2604
+ * Retrieves details about an OAuth authorization request.
2605
+ * Used to display consent information to the user.
2606
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2607
+ *
2608
+ * This method returns one of two response types:
2609
+ * - `OAuthAuthorizationDetails`: User needs to consent - show consent page with client info
2610
+ * - `OAuthRedirect`: User already consented - redirect immediately to the OAuth client
2611
+ *
2612
+ * Use type narrowing to distinguish between the responses:
2613
+ * ```typescript
2614
+ * if ('authorization_id' in data) {
2615
+ * // Show consent page
2616
+ * } else {
2617
+ * // Redirect to data.redirect_url
2618
+ * }
2619
+ * ```
2620
+ *
2621
+ * @param authorizationId - The authorization ID from the authorization request
2622
+ * @returns Authorization details or redirect URL depending on consent status
2623
+ *
2624
+ * @category Auth
2625
+ * @subcategory OAuth Server
2626
+ */
2627
+ getAuthorizationDetails(authorizationId: string): Promise<AuthOAuthAuthorizationDetailsResponse>
2628
+
2629
+ /**
2630
+ * Approves an OAuth authorization request.
2631
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2632
+ *
2633
+ * After approval, the user's consent is stored and an authorization code is generated.
2634
+ * The response contains a complete redirect URL with the authorization code and state.
2635
+ *
2636
+ * @param authorizationId - The authorization ID to approve
2637
+ * @param options - Optional parameters
2638
+ * @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).
2639
+ * @returns Redirect URL to send the user back to the OAuth client with authorization code
2640
+ *
2641
+ * @category Auth
2642
+ * @subcategory OAuth Server
2643
+ */
2644
+ approveAuthorization(
2645
+ authorizationId: string,
2646
+ options?: { skipBrowserRedirect?: boolean }
2647
+ ): Promise<AuthOAuthConsentResponse>
2648
+
2649
+ /**
2650
+ * Denies an OAuth authorization request.
2651
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2652
+ *
2653
+ * After denial, the response contains a redirect URL with an OAuth error
2654
+ * (access_denied) to inform the OAuth client that the user rejected the request.
2655
+ *
2656
+ * @param authorizationId - The authorization ID to deny
2657
+ * @param options - Optional parameters
2658
+ * @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).
2659
+ * @returns Redirect URL to send the user back to the OAuth client with error information
2660
+ *
2661
+ * @category Auth
2662
+ * @subcategory OAuth Server
2663
+ */
2664
+ denyAuthorization(
2665
+ authorizationId: string,
2666
+ options?: { skipBrowserRedirect?: boolean }
2667
+ ): Promise<AuthOAuthConsentResponse>
2668
+
2669
+ /**
2670
+ * Lists all OAuth grants that the authenticated user has authorized.
2671
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2672
+ *
2673
+ * @returns Response with array of OAuth grants with client information and granted scopes
2674
+ *
2675
+ * @category Auth
2676
+ * @subcategory OAuth Server
2677
+ */
2678
+ listGrants(): Promise<AuthOAuthGrantsResponse>
2679
+
2680
+ /**
2681
+ * Revokes a user's OAuth grant for a specific client.
2682
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2683
+ *
2684
+ * Revocation marks consent as revoked, deletes active sessions for that OAuth client,
2685
+ * and invalidates associated refresh tokens.
2686
+ *
2687
+ * @param options - Revocation options
2688
+ * @param options.clientId - The OAuth client identifier (UUID) to revoke access for
2689
+ * @returns Empty response on successful revocation
2690
+ *
2691
+ * @category Auth
2692
+ * @subcategory OAuth Server
2693
+ */
2694
+ revokeGrant(options: { clientId: string }): Promise<AuthOAuthRevokeGrantResponse>
2695
+ }
2696
+
2697
+ // --- Passkey Types ---
2698
+
2699
+ /** Response from POST /passkeys/registration/options */
2700
+ export type PasskeyRegistrationOptionsResponse = {
2701
+ challenge_id: string
2702
+ options: ServerCredentialCreationOptions
2703
+ expires_at: number
2704
+ }
2705
+
2706
+ /** Request body for POST /passkeys/registration/verify */
2707
+ export type PasskeyRegistrationVerifyParams = {
2708
+ challenge_id: string
2709
+ credential: RegistrationResponseJSON
2710
+ }
2711
+
2712
+ /** Response from POST /passkeys/registration/verify */
2713
+ export type PasskeyMetadata = {
2714
+ id: string
2715
+ friendly_name?: string
2716
+ created_at: string
2717
+ }
2718
+
2719
+ /** Response from POST /passkeys/authentication/options */
2720
+ export type PasskeyAuthenticationOptionsResponse = {
2721
+ challenge_id: string
2722
+ options: ServerCredentialRequestOptions
2723
+ expires_at: number
2724
+ }
2725
+
2726
+ /** Request body for POST /passkeys/authentication/verify */
2727
+ export type PasskeyAuthenticationVerifyParams = {
2728
+ challenge_id: string
2729
+ credential: AuthenticationResponseJSON
2730
+ }
2731
+
2732
+ /** Item in the passkeys list (GET /passkeys/ and admin list) */
2733
+ export type PasskeyListItem = {
2734
+ id: string
2735
+ friendly_name?: string
2736
+ created_at: string
2737
+ last_used_at?: string
2738
+ }
2739
+
2740
+ // --- Passkey SDK Method Parameter/Response Types ---
2741
+
2742
+ export type SignInWithPasskeyCredentials = {
2743
+ options?: {
2744
+ captchaToken?: string
2745
+ signal?: AbortSignal
2746
+ }
2747
+ }
2748
+
2749
+ export type RegisterPasskeyCredentials = {
2750
+ options?: {
2751
+ signal?: AbortSignal
2752
+ }
2753
+ }
2754
+
2755
+ export type VerifyPasskeyRegistrationParams = {
2756
+ /** Challenge ID from startRegistration */
2757
+ challengeId: string
2758
+ /** Serialized credential from navigator.credentials.create() */
2759
+ credential: ServerCredentialResponse
2760
+ }
2761
+
2762
+ export type StartPasskeyAuthenticationParams = {
2763
+ options?: {
2764
+ captchaToken?: string
2765
+ }
2766
+ }
2767
+
2768
+ export type VerifyPasskeyAuthenticationParams = {
2769
+ /** Challenge ID from startAuthentication */
2770
+ challengeId: string
2771
+ /** Serialized credential from navigator.credentials.get() */
2772
+ credential: ServerCredentialResponse
2773
+ }
2774
+
2775
+ export type PasskeyUpdateParams = {
2776
+ /** UUID of the passkey to update */
2777
+ passkeyId: string
2778
+ /** New friendly name (max 120 chars) */
2779
+ friendlyName: string
2780
+ }
2781
+
2782
+ export type PasskeyDeleteParams = {
2783
+ /** UUID of the passkey to delete */
2784
+ passkeyId: string
2785
+ }
2786
+
2787
+ // --- Passkey Response Types ---
2788
+
2789
+ export type AuthPasskeyRegistrationOptionsResponse =
2790
+ RequestResult<PasskeyRegistrationOptionsResponse>
2791
+ export type AuthPasskeyRegistrationVerifyResponse = RequestResult<
2792
+ PasskeyMetadata,
2793
+ WebAuthnError | AuthError
2794
+ >
2795
+ export type AuthPasskeyAuthenticationOptionsResponse =
2796
+ RequestResult<PasskeyAuthenticationOptionsResponse>
2797
+ export type AuthPasskeyAuthenticationVerifyResponse = RequestResult<
2798
+ { session: Session | null; user: User | null },
2799
+ WebAuthnError | AuthError
2800
+ >
2801
+ export type AuthPasskeyListResponse = RequestResult<PasskeyListItem[]>
2802
+ export type AuthPasskeyUpdateResponse = RequestResult<PasskeyListItem>
2803
+ export type AuthPasskeyDeleteResponse = RequestResult<null>
2804
+
2805
+ // --- Passkey Admin Types ---
2806
+
2807
+ export type AuthPasskeyAdminListParams = {
2808
+ userId: string
2809
+ }
2810
+
2811
+ export type AuthPasskeyAdminDeleteParams = {
2812
+ userId: string
2813
+ passkeyId: string
2814
+ }
2815
+
2816
+ // --- Passkey Namespace Interfaces ---
2817
+
2818
+ /**
2819
+ * Lower-level two-step API and management methods for passkeys.
2820
+ * Access via `supabase.auth.passkey`.
2821
+ */
2822
+ export interface AuthPasskeyApi {
2823
+ // Two-step registration
2824
+ /**
2825
+ * Starts the passkey registration ceremony. Fetches a registration challenge
2826
+ * and credential creation options from the server. Used as the first step of
2827
+ * a two-step registration flow when the caller wants to handle
2828
+ * `navigator.credentials.create()` themselves.
2829
+ *
2830
+ * @category Auth
2831
+ * @subcategory Auth Passkey
2832
+ */
2833
+ startRegistration(): Promise<AuthPasskeyRegistrationOptionsResponse>
2834
+
2835
+ /**
2836
+ * Verifies a passkey registration credential against a previously issued
2837
+ * challenge. Used as the second step of a two-step registration flow.
2838
+ *
2839
+ * @category Auth
2840
+ * @subcategory Auth Passkey
2841
+ */
2842
+ verifyRegistration(
2843
+ params: VerifyPasskeyRegistrationParams
2844
+ ): Promise<AuthPasskeyRegistrationVerifyResponse>
2845
+
2846
+ // Two-step authentication
2847
+ /**
2848
+ * Starts the passkey authentication ceremony. Fetches an authentication
2849
+ * challenge and credential request options from the server. Used as the
2850
+ * first step of a two-step sign-in flow when the caller wants to handle
2851
+ * `navigator.credentials.get()` themselves.
2852
+ *
2853
+ * @category Auth
2854
+ * @subcategory Auth Passkey
2855
+ */
2856
+ startAuthentication(
2857
+ params?: StartPasskeyAuthenticationParams
2858
+ ): Promise<AuthPasskeyAuthenticationOptionsResponse>
2859
+
2860
+ /**
2861
+ * Verifies a passkey authentication credential against a previously issued
2862
+ * challenge. Used as the second step of a two-step sign-in flow.
2863
+ *
2864
+ * @category Auth
2865
+ * @subcategory Auth Passkey
2866
+ */
2867
+ verifyAuthentication(
2868
+ params: VerifyPasskeyAuthenticationParams
2869
+ ): Promise<AuthPasskeyAuthenticationVerifyResponse>
2870
+
2871
+ // Management
2872
+ /**
2873
+ * Lists all passkeys registered for the currently signed-in user.
2874
+ *
2875
+ * @category Auth
2876
+ * @subcategory Auth Passkey
2877
+ */
2878
+ list(): Promise<AuthPasskeyListResponse>
2879
+
2880
+ /**
2881
+ * Updates a passkey's friendly name.
2882
+ *
2883
+ * @category Auth
2884
+ * @subcategory Auth Passkey
2885
+ */
2886
+ update(params: PasskeyUpdateParams): Promise<AuthPasskeyUpdateResponse>
2887
+
2888
+ /**
2889
+ * Deletes a passkey for the currently signed-in user.
2890
+ *
2891
+ * @category Auth
2892
+ * @subcategory Auth Passkey
2893
+ */
2894
+ delete(params: PasskeyDeleteParams): Promise<AuthPasskeyDeleteResponse>
2895
+ }
2896
+
2897
+ export interface GoTrueAdminPasskeyApi {
2898
+ /**
2899
+ * Lists all passkeys registered for a specific user.
2900
+ *
2901
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2902
+ *
2903
+ * @category Auth
2904
+ * @subcategory Passkey Admin
2905
+ */
2906
+ listPasskeys(params: AuthPasskeyAdminListParams): Promise<AuthPasskeyListResponse>
2907
+
2908
+ /**
2909
+ * Deletes a specific passkey for a specific user.
2910
+ *
2911
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2912
+ *
2913
+ * @category Auth
2914
+ * @subcategory Passkey Admin
2915
+ */
2916
+ deletePasskey(params: AuthPasskeyAdminDeleteParams): Promise<AuthPasskeyDeleteResponse>
2917
+ }