@stytch/react 20.0.0-next.1 → 20.0.0-next.3

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 (580) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/StytchSSRProxy-Bz6LNYdq.js.map +1 -1
  3. package/dist/cjs/adminPortal/index.cjs +1 -1
  4. package/dist/cjs/b2b/index.cjs +14 -13
  5. package/dist/cjs/b2b/index.cjs.map +1 -1
  6. package/dist/cjs/compat.cjs +3647 -0
  7. package/dist/cjs/compat.cjs.map +1 -0
  8. package/dist/cjs/{index-Ni_dyEsz.js → index-BIjXBvf_.js} +2 -2
  9. package/dist/cjs/index-BIjXBvf_.js.map +1 -0
  10. package/dist/cjs/index.cjs +521 -520
  11. package/dist/cjs/index.cjs.map +1 -1
  12. package/dist/cjs/{shadcn-B8TEzQMT.js → shadcn-Z4AvHriT.js} +247 -233
  13. package/dist/cjs/shadcn-Z4AvHriT.js.map +1 -0
  14. package/dist/cjs-dev/StytchSSRProxy-d553KgcY.js +438 -0
  15. package/dist/cjs-dev/StytchSSRProxy-d553KgcY.js.map +1 -0
  16. package/dist/cjs-dev/adminPortal/index.cjs +54 -53
  17. package/dist/cjs-dev/adminPortal/index.cjs.map +1 -1
  18. package/dist/cjs-dev/b2b/index.cjs +85 -72
  19. package/dist/cjs-dev/b2b/index.cjs.map +1 -1
  20. package/dist/cjs-dev/b2b/index.headless.cjs +94 -92
  21. package/dist/cjs-dev/b2b/index.headless.cjs.map +1 -1
  22. package/dist/cjs-dev/compat.cjs +3694 -0
  23. package/dist/cjs-dev/compat.cjs.map +1 -0
  24. package/dist/cjs-dev/{StytchSSRProxy-CxXsyme4.js → dev-DaCGDI6V.js} +60 -426
  25. package/dist/cjs-dev/dev-DaCGDI6V.js.map +1 -0
  26. package/dist/cjs-dev/{idpHelpers-Cf8Qq1B4.js → idpHelpers-DOYYSxsX.js} +60 -141
  27. package/dist/cjs-dev/idpHelpers-DOYYSxsX.js.map +1 -0
  28. package/dist/cjs-dev/{index-DdK3Jt4u.js → index-rquGmIlv.js} +4 -4
  29. package/dist/cjs-dev/index-rquGmIlv.js.map +1 -0
  30. package/dist/cjs-dev/index.cjs +828 -805
  31. package/dist/cjs-dev/index.cjs.map +1 -1
  32. package/dist/cjs-dev/index.headless.cjs +76 -74
  33. package/dist/cjs-dev/index.headless.cjs.map +1 -1
  34. package/dist/cjs-dev/logger-CvOATP4R.js +28 -0
  35. package/dist/cjs-dev/logger-CvOATP4R.js.map +1 -0
  36. package/dist/cjs-dev/{passwordManagerDisableAutofillProps-D70WyvIu.js → passwordManagerDisableAutofillProps-CgiK2M_U.js} +2 -2
  37. package/dist/cjs-dev/{passwordManagerDisableAutofillProps-D70WyvIu.js.map → passwordManagerDisableAutofillProps-CgiK2M_U.js.map} +1 -1
  38. package/dist/cjs-dev/{shadcn-C4w3DtKK.js → shadcn-DnNfms7-.js} +261 -245
  39. package/dist/cjs-dev/shadcn-DnNfms7-.js.map +1 -0
  40. package/dist/esm/b2b/StytchB2BContext.mjs +5 -5
  41. package/dist/esm/b2b/StytchB2BContext.mjs.map +1 -1
  42. package/dist/esm/compat.mjs +3 -0
  43. package/dist/esm/compat.mjs.map +1 -0
  44. package/dist/esm/node_modules/chroma-js/index.mjs +85 -0
  45. package/dist/esm/node_modules/chroma-js/index.mjs.map +1 -0
  46. package/dist/esm/node_modules/chroma-js/src/Color.mjs +53 -0
  47. package/dist/esm/node_modules/chroma-js/src/Color.mjs.map +1 -0
  48. package/dist/esm/node_modules/chroma-js/src/chroma.mjs +11 -0
  49. package/dist/esm/node_modules/chroma-js/src/chroma.mjs.map +1 -0
  50. package/dist/esm/node_modules/chroma-js/src/colors/colorbrewer.mjs +82 -0
  51. package/dist/esm/node_modules/chroma-js/src/colors/colorbrewer.mjs.map +1 -0
  52. package/dist/esm/node_modules/chroma-js/src/colors/w3cx11.mjs +165 -0
  53. package/dist/esm/node_modules/chroma-js/src/colors/w3cx11.mjs.map +1 -0
  54. package/dist/esm/node_modules/chroma-js/src/generator/average.mjs +92 -0
  55. package/dist/esm/node_modules/chroma-js/src/generator/average.mjs.map +1 -0
  56. package/dist/esm/node_modules/chroma-js/src/generator/bezier.mjs +89 -0
  57. package/dist/esm/node_modules/chroma-js/src/generator/bezier.mjs.map +1 -0
  58. package/dist/esm/node_modules/chroma-js/src/generator/blend.mjs +58 -0
  59. package/dist/esm/node_modules/chroma-js/src/generator/blend.mjs.map +1 -0
  60. package/dist/esm/node_modules/chroma-js/src/generator/cubehelix.mjs +93 -0
  61. package/dist/esm/node_modules/chroma-js/src/generator/cubehelix.mjs.map +1 -0
  62. package/dist/esm/node_modules/chroma-js/src/generator/mix.mjs +22 -0
  63. package/dist/esm/node_modules/chroma-js/src/generator/mix.mjs.map +1 -0
  64. package/dist/esm/node_modules/chroma-js/src/generator/random.mjs +16 -0
  65. package/dist/esm/node_modules/chroma-js/src/generator/random.mjs.map +1 -0
  66. package/dist/esm/node_modules/chroma-js/src/generator/scale.mjs +398 -0
  67. package/dist/esm/node_modules/chroma-js/src/generator/scale.mjs.map +1 -0
  68. package/dist/esm/node_modules/chroma-js/src/interpolator/_hsx.mjs +62 -0
  69. package/dist/esm/node_modules/chroma-js/src/interpolator/_hsx.mjs.map +1 -0
  70. package/dist/esm/node_modules/chroma-js/src/interpolator/hcg.mjs +13 -0
  71. package/dist/esm/node_modules/chroma-js/src/interpolator/hcg.mjs.map +1 -0
  72. package/dist/esm/node_modules/chroma-js/src/interpolator/hsi.mjs +13 -0
  73. package/dist/esm/node_modules/chroma-js/src/interpolator/hsi.mjs.map +1 -0
  74. package/dist/esm/node_modules/chroma-js/src/interpolator/hsl.mjs +13 -0
  75. package/dist/esm/node_modules/chroma-js/src/interpolator/hsl.mjs.map +1 -0
  76. package/dist/esm/node_modules/chroma-js/src/interpolator/hsv.mjs +13 -0
  77. package/dist/esm/node_modules/chroma-js/src/interpolator/hsv.mjs.map +1 -0
  78. package/dist/esm/node_modules/chroma-js/src/interpolator/index.mjs +4 -0
  79. package/dist/esm/node_modules/chroma-js/src/interpolator/index.mjs.map +1 -0
  80. package/dist/esm/node_modules/chroma-js/src/interpolator/lab.mjs +20 -0
  81. package/dist/esm/node_modules/chroma-js/src/interpolator/lab.mjs.map +1 -0
  82. package/dist/esm/node_modules/chroma-js/src/interpolator/lch.mjs +14 -0
  83. package/dist/esm/node_modules/chroma-js/src/interpolator/lch.mjs.map +1 -0
  84. package/dist/esm/node_modules/chroma-js/src/interpolator/lrgb.mjs +21 -0
  85. package/dist/esm/node_modules/chroma-js/src/interpolator/lrgb.mjs.map +1 -0
  86. package/dist/esm/node_modules/chroma-js/src/interpolator/num.mjs +15 -0
  87. package/dist/esm/node_modules/chroma-js/src/interpolator/num.mjs.map +1 -0
  88. package/dist/esm/node_modules/chroma-js/src/interpolator/oklab.mjs +20 -0
  89. package/dist/esm/node_modules/chroma-js/src/interpolator/oklab.mjs.map +1 -0
  90. package/dist/esm/node_modules/chroma-js/src/interpolator/oklch.mjs +13 -0
  91. package/dist/esm/node_modules/chroma-js/src/interpolator/oklch.mjs.map +1 -0
  92. package/dist/esm/node_modules/chroma-js/src/interpolator/rgb.mjs +19 -0
  93. package/dist/esm/node_modules/chroma-js/src/interpolator/rgb.mjs.map +1 -0
  94. package/dist/esm/node_modules/chroma-js/src/io/cmyk/cmyk2rgb.mjs +18 -0
  95. package/dist/esm/node_modules/chroma-js/src/io/cmyk/cmyk2rgb.mjs.map +1 -0
  96. package/dist/esm/node_modules/chroma-js/src/io/cmyk/index.mjs +29 -0
  97. package/dist/esm/node_modules/chroma-js/src/io/cmyk/index.mjs.map +1 -0
  98. package/dist/esm/node_modules/chroma-js/src/io/cmyk/rgb2cmyk.mjs +20 -0
  99. package/dist/esm/node_modules/chroma-js/src/io/cmyk/rgb2cmyk.mjs.map +1 -0
  100. package/dist/esm/node_modules/chroma-js/src/io/css/css2rgb.mjs +239 -0
  101. package/dist/esm/node_modules/chroma-js/src/io/css/css2rgb.mjs.map +1 -0
  102. package/dist/esm/node_modules/chroma-js/src/io/css/hsl2css.mjs +29 -0
  103. package/dist/esm/node_modules/chroma-js/src/io/css/hsl2css.mjs.map +1 -0
  104. package/dist/esm/node_modules/chroma-js/src/io/css/index.mjs +27 -0
  105. package/dist/esm/node_modules/chroma-js/src/io/css/index.mjs.map +1 -0
  106. package/dist/esm/node_modules/chroma-js/src/io/css/lab2css.mjs +27 -0
  107. package/dist/esm/node_modules/chroma-js/src/io/css/lab2css.mjs.map +1 -0
  108. package/dist/esm/node_modules/chroma-js/src/io/css/lch2css.mjs +27 -0
  109. package/dist/esm/node_modules/chroma-js/src/io/css/lch2css.mjs.map +1 -0
  110. package/dist/esm/node_modules/chroma-js/src/io/css/oklab2css.mjs +18 -0
  111. package/dist/esm/node_modules/chroma-js/src/io/css/oklab2css.mjs.map +1 -0
  112. package/dist/esm/node_modules/chroma-js/src/io/css/oklch2css.mjs +18 -0
  113. package/dist/esm/node_modules/chroma-js/src/io/css/oklch2css.mjs.map +1 -0
  114. package/dist/esm/node_modules/chroma-js/src/io/css/rgb2css.mjs +65 -0
  115. package/dist/esm/node_modules/chroma-js/src/io/css/rgb2css.mjs.map +1 -0
  116. package/dist/esm/node_modules/chroma-js/src/io/gl/index.mjs +24 -0
  117. package/dist/esm/node_modules/chroma-js/src/io/gl/index.mjs.map +1 -0
  118. package/dist/esm/node_modules/chroma-js/src/io/hcg/hcg2rgb.mjs +58 -0
  119. package/dist/esm/node_modules/chroma-js/src/io/hcg/hcg2rgb.mjs.map +1 -0
  120. package/dist/esm/node_modules/chroma-js/src/io/hcg/index.mjs +29 -0
  121. package/dist/esm/node_modules/chroma-js/src/io/hcg/index.mjs.map +1 -0
  122. package/dist/esm/node_modules/chroma-js/src/io/hcg/rgb2hcg.mjs +25 -0
  123. package/dist/esm/node_modules/chroma-js/src/io/hcg/rgb2hcg.mjs.map +1 -0
  124. package/dist/esm/node_modules/chroma-js/src/io/hex/hex2rgb.mjs +57 -0
  125. package/dist/esm/node_modules/chroma-js/src/io/hex/hex2rgb.mjs.map +1 -0
  126. package/dist/esm/node_modules/chroma-js/src/io/hex/index.mjs +30 -0
  127. package/dist/esm/node_modules/chroma-js/src/io/hex/index.mjs.map +1 -0
  128. package/dist/esm/node_modules/chroma-js/src/io/hex/rgb2hex.mjs +33 -0
  129. package/dist/esm/node_modules/chroma-js/src/io/hex/rgb2hex.mjs.map +1 -0
  130. package/dist/esm/node_modules/chroma-js/src/io/hsi/hsi2rgb.mjs +49 -0
  131. package/dist/esm/node_modules/chroma-js/src/io/hsi/hsi2rgb.mjs.map +1 -0
  132. package/dist/esm/node_modules/chroma-js/src/io/hsi/index.mjs +29 -0
  133. package/dist/esm/node_modules/chroma-js/src/io/hsi/index.mjs.map +1 -0
  134. package/dist/esm/node_modules/chroma-js/src/io/hsi/rgb2hsi.mjs +34 -0
  135. package/dist/esm/node_modules/chroma-js/src/io/hsi/rgb2hsi.mjs.map +1 -0
  136. package/dist/esm/node_modules/chroma-js/src/io/hsl/hsl2rgb.mjs +37 -0
  137. package/dist/esm/node_modules/chroma-js/src/io/hsl/hsl2rgb.mjs.map +1 -0
  138. package/dist/esm/node_modules/chroma-js/src/io/hsl/index.mjs +29 -0
  139. package/dist/esm/node_modules/chroma-js/src/io/hsl/index.mjs.map +1 -0
  140. package/dist/esm/node_modules/chroma-js/src/io/hsl/rgb2hsl.mjs +47 -0
  141. package/dist/esm/node_modules/chroma-js/src/io/hsl/rgb2hsl.mjs.map +1 -0
  142. package/dist/esm/node_modules/chroma-js/src/io/hsv/hsv2rgb.mjs +50 -0
  143. package/dist/esm/node_modules/chroma-js/src/io/hsv/hsv2rgb.mjs.map +1 -0
  144. package/dist/esm/node_modules/chroma-js/src/io/hsv/index.mjs +29 -0
  145. package/dist/esm/node_modules/chroma-js/src/io/hsv/index.mjs.map +1 -0
  146. package/dist/esm/node_modules/chroma-js/src/io/hsv/rgb2hsv.mjs +35 -0
  147. package/dist/esm/node_modules/chroma-js/src/io/hsv/rgb2hsv.mjs.map +1 -0
  148. package/dist/esm/node_modules/chroma-js/src/io/input.mjs +7 -0
  149. package/dist/esm/node_modules/chroma-js/src/io/input.mjs.map +1 -0
  150. package/dist/esm/node_modules/chroma-js/src/io/lab/index.mjs +30 -0
  151. package/dist/esm/node_modules/chroma-js/src/io/lab/index.mjs.map +1 -0
  152. package/dist/esm/node_modules/chroma-js/src/io/lab/lab-constants.mjs +116 -0
  153. package/dist/esm/node_modules/chroma-js/src/io/lab/lab-constants.mjs.map +1 -0
  154. package/dist/esm/node_modules/chroma-js/src/io/lab/lab2rgb.mjs +102 -0
  155. package/dist/esm/node_modules/chroma-js/src/io/lab/lab2rgb.mjs.map +1 -0
  156. package/dist/esm/node_modules/chroma-js/src/io/lab/rgb2lab.mjs +68 -0
  157. package/dist/esm/node_modules/chroma-js/src/io/lab/rgb2lab.mjs.map +1 -0
  158. package/dist/esm/node_modules/chroma-js/src/io/lch/hcl2rgb.mjs +11 -0
  159. package/dist/esm/node_modules/chroma-js/src/io/lch/hcl2rgb.mjs.map +1 -0
  160. package/dist/esm/node_modules/chroma-js/src/io/lch/index.mjs +38 -0
  161. package/dist/esm/node_modules/chroma-js/src/io/lch/index.mjs.map +1 -0
  162. package/dist/esm/node_modules/chroma-js/src/io/lch/lab2lch.mjs +15 -0
  163. package/dist/esm/node_modules/chroma-js/src/io/lch/lab2lch.mjs.map +1 -0
  164. package/dist/esm/node_modules/chroma-js/src/io/lch/lch2lab.mjs +21 -0
  165. package/dist/esm/node_modules/chroma-js/src/io/lch/lch2lab.mjs.map +1 -0
  166. package/dist/esm/node_modules/chroma-js/src/io/lch/lch2rgb.mjs +15 -0
  167. package/dist/esm/node_modules/chroma-js/src/io/lch/lch2rgb.mjs.map +1 -0
  168. package/dist/esm/node_modules/chroma-js/src/io/lch/rgb2lch.mjs +14 -0
  169. package/dist/esm/node_modules/chroma-js/src/io/lch/rgb2lch.mjs.map +1 -0
  170. package/dist/esm/node_modules/chroma-js/src/io/named/index.mjs +30 -0
  171. package/dist/esm/node_modules/chroma-js/src/io/named/index.mjs.map +1 -0
  172. package/dist/esm/node_modules/chroma-js/src/io/num/index.mjs +33 -0
  173. package/dist/esm/node_modules/chroma-js/src/io/num/index.mjs.map +1 -0
  174. package/dist/esm/node_modules/chroma-js/src/io/num/num2rgb.mjs +14 -0
  175. package/dist/esm/node_modules/chroma-js/src/io/num/num2rgb.mjs.map +1 -0
  176. package/dist/esm/node_modules/chroma-js/src/io/num/rgb2num.mjs +10 -0
  177. package/dist/esm/node_modules/chroma-js/src/io/num/rgb2num.mjs.map +1 -0
  178. package/dist/esm/node_modules/chroma-js/src/io/oklab/index.mjs +29 -0
  179. package/dist/esm/node_modules/chroma-js/src/io/oklab/index.mjs.map +1 -0
  180. package/dist/esm/node_modules/chroma-js/src/io/oklab/oklab2rgb.mjs +36 -0
  181. package/dist/esm/node_modules/chroma-js/src/io/oklab/oklab2rgb.mjs.map +1 -0
  182. package/dist/esm/node_modules/chroma-js/src/io/oklab/rgb2oklab.mjs +39 -0
  183. package/dist/esm/node_modules/chroma-js/src/io/oklab/rgb2oklab.mjs.map +1 -0
  184. package/dist/esm/node_modules/chroma-js/src/io/oklch/index.mjs +29 -0
  185. package/dist/esm/node_modules/chroma-js/src/io/oklch/index.mjs.map +1 -0
  186. package/dist/esm/node_modules/chroma-js/src/io/oklch/oklch2rgb.mjs +15 -0
  187. package/dist/esm/node_modules/chroma-js/src/io/oklch/oklch2rgb.mjs.map +1 -0
  188. package/dist/esm/node_modules/chroma-js/src/io/oklch/rgb2oklch.mjs +14 -0
  189. package/dist/esm/node_modules/chroma-js/src/io/oklch/rgb2oklch.mjs.map +1 -0
  190. package/dist/esm/node_modules/chroma-js/src/io/rgb/index.mjs +47 -0
  191. package/dist/esm/node_modules/chroma-js/src/io/rgb/index.mjs.map +1 -0
  192. package/dist/esm/node_modules/chroma-js/src/io/temp/index.mjs +23 -0
  193. package/dist/esm/node_modules/chroma-js/src/io/temp/index.mjs.map +1 -0
  194. package/dist/esm/node_modules/chroma-js/src/io/temp/rgb2temperature.mjs +33 -0
  195. package/dist/esm/node_modules/chroma-js/src/io/temp/rgb2temperature.mjs.map +1 -0
  196. package/dist/esm/node_modules/chroma-js/src/io/temp/temperature2rgb.mjs +40 -0
  197. package/dist/esm/node_modules/chroma-js/src/io/temp/temperature2rgb.mjs.map +1 -0
  198. package/dist/esm/node_modules/chroma-js/src/ops/alpha.mjs +14 -0
  199. package/dist/esm/node_modules/chroma-js/src/ops/alpha.mjs.map +1 -0
  200. package/dist/esm/node_modules/chroma-js/src/ops/clipped.mjs +6 -0
  201. package/dist/esm/node_modules/chroma-js/src/ops/clipped.mjs.map +1 -0
  202. package/dist/esm/node_modules/chroma-js/src/ops/darken.mjs +18 -0
  203. package/dist/esm/node_modules/chroma-js/src/ops/darken.mjs.map +1 -0
  204. package/dist/esm/node_modules/chroma-js/src/ops/get.mjs +14 -0
  205. package/dist/esm/node_modules/chroma-js/src/ops/get.mjs.map +1 -0
  206. package/dist/esm/node_modules/chroma-js/src/ops/luminance.mjs +56 -0
  207. package/dist/esm/node_modules/chroma-js/src/ops/luminance.mjs.map +1 -0
  208. package/dist/esm/node_modules/chroma-js/src/ops/mix.mjs +11 -0
  209. package/dist/esm/node_modules/chroma-js/src/ops/mix.mjs.map +1 -0
  210. package/dist/esm/node_modules/chroma-js/src/ops/premultiply.mjs +13 -0
  211. package/dist/esm/node_modules/chroma-js/src/ops/premultiply.mjs.map +1 -0
  212. package/dist/esm/node_modules/chroma-js/src/ops/saturate.mjs +16 -0
  213. package/dist/esm/node_modules/chroma-js/src/ops/saturate.mjs.map +1 -0
  214. package/dist/esm/node_modules/chroma-js/src/ops/set.mjs +44 -0
  215. package/dist/esm/node_modules/chroma-js/src/ops/set.mjs.map +1 -0
  216. package/dist/esm/node_modules/chroma-js/src/ops/shade.mjs +12 -0
  217. package/dist/esm/node_modules/chroma-js/src/ops/shade.mjs.map +1 -0
  218. package/dist/esm/node_modules/chroma-js/src/utils/analyze.mjs +194 -0
  219. package/dist/esm/node_modules/chroma-js/src/utils/analyze.mjs.map +1 -0
  220. package/dist/esm/node_modules/chroma-js/src/utils/clip_rgb.mjs +18 -0
  221. package/dist/esm/node_modules/chroma-js/src/utils/clip_rgb.mjs.map +1 -0
  222. package/dist/esm/node_modules/chroma-js/src/utils/contrast.mjs +15 -0
  223. package/dist/esm/node_modules/chroma-js/src/utils/contrast.mjs.map +1 -0
  224. package/dist/esm/node_modules/chroma-js/src/utils/contrastAPCA.mjs +71 -0
  225. package/dist/esm/node_modules/chroma-js/src/utils/contrastAPCA.mjs.map +1 -0
  226. package/dist/esm/node_modules/chroma-js/src/utils/delta-e.mjs +66 -0
  227. package/dist/esm/node_modules/chroma-js/src/utils/delta-e.mjs.map +1 -0
  228. package/dist/esm/node_modules/chroma-js/src/utils/distance.mjs +20 -0
  229. package/dist/esm/node_modules/chroma-js/src/utils/distance.mjs.map +1 -0
  230. package/dist/esm/node_modules/chroma-js/src/utils/index.mjs +24 -0
  231. package/dist/esm/node_modules/chroma-js/src/utils/index.mjs.map +1 -0
  232. package/dist/esm/node_modules/chroma-js/src/utils/last.mjs +11 -0
  233. package/dist/esm/node_modules/chroma-js/src/utils/last.mjs.map +1 -0
  234. package/dist/esm/node_modules/chroma-js/src/utils/limit.mjs +8 -0
  235. package/dist/esm/node_modules/chroma-js/src/utils/limit.mjs.map +1 -0
  236. package/dist/esm/node_modules/chroma-js/src/utils/multiply-matrices.mjs +39 -0
  237. package/dist/esm/node_modules/chroma-js/src/utils/multiply-matrices.mjs.map +1 -0
  238. package/dist/esm/node_modules/chroma-js/src/utils/scales.mjs +19 -0
  239. package/dist/esm/node_modules/chroma-js/src/utils/scales.mjs.map +1 -0
  240. package/dist/esm/node_modules/chroma-js/src/utils/type.mjs +21 -0
  241. package/dist/esm/node_modules/chroma-js/src/utils/type.mjs.map +1 -0
  242. package/dist/esm/node_modules/chroma-js/src/utils/unpack.mjs +20 -0
  243. package/dist/esm/node_modules/chroma-js/src/utils/unpack.mjs.map +1 -0
  244. package/dist/esm/node_modules/chroma-js/src/utils/valid.mjs +14 -0
  245. package/dist/esm/node_modules/chroma-js/src/utils/valid.mjs.map +1 -0
  246. package/dist/esm/node_modules/chroma-js/src/version.mjs +5 -0
  247. package/dist/esm/node_modules/chroma-js/src/version.mjs.map +1 -0
  248. package/dist/esm/packages/core/src/public/b2b/ui.mjs.map +1 -1
  249. package/dist/esm/packages/web/src/ui/b2b/App.mjs +2 -2
  250. package/dist/esm/packages/web/src/ui/b2b/App.mjs.map +1 -1
  251. package/dist/esm/packages/web/src/ui/b2b/components/Icons.mjs +3 -1
  252. package/dist/esm/packages/web/src/ui/b2b/components/Icons.mjs.map +1 -1
  253. package/dist/esm/packages/web/src/ui/b2c/AppContainer.mjs +1 -1
  254. package/dist/esm/packages/web/src/ui/b2c/AppContainer.mjs.map +1 -1
  255. package/dist/esm/packages/web/src/ui/b2c/IDPContainer.mjs +1 -1
  256. package/dist/esm/packages/web/src/ui/b2c/IDPContainer.mjs.map +1 -1
  257. package/dist/esm/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs +1 -1
  258. package/dist/esm/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs.map +1 -1
  259. package/dist/esm/packages/web/src/ui/b2c/ResetPasswordContainer.mjs +1 -1
  260. package/dist/esm/packages/web/src/ui/b2c/ResetPasswordContainer.mjs.map +1 -1
  261. package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs +12 -11
  262. package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs.map +1 -1
  263. package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs +12 -14
  264. package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs.map +1 -1
  265. package/dist/esm/packages/web/src/ui/b2c/screens/Secondary/PasswordlessAuthenticate.mjs +6 -2
  266. package/dist/esm/packages/web/src/ui/b2c/screens/Secondary/PasswordlessAuthenticate.mjs.map +1 -1
  267. package/dist/esm/packages/web/src/ui/b2c/screens/Secondary/usePasswordlessAuthenticate.mjs +10 -0
  268. package/dist/esm/packages/web/src/ui/b2c/screens/Secondary/usePasswordlessAuthenticate.mjs.map +1 -1
  269. package/dist/esm/packages/web/src/ui/compat/generateColorFallback.mjs +63 -0
  270. package/dist/esm/packages/web/src/ui/compat/generateColorFallback.mjs.map +1 -0
  271. package/dist/esm/packages/web/src/ui/compat/styleToTheme.mjs +119 -0
  272. package/dist/esm/packages/web/src/ui/compat/styleToTheme.mjs.map +1 -0
  273. package/dist/esm/packages/web/src/ui/components/PresentationConfig.mjs.map +1 -1
  274. package/dist/esm/packages/web/src/ui/components/atoms/Typography.module.css.mjs +2 -2
  275. package/dist/esm/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs +1 -1
  276. package/dist/esm/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs.map +1 -1
  277. package/dist/esm/packages/web/src/ui/react/b2b/Stytch.mjs +1 -1
  278. package/dist/esm/packages/web/src/ui/react/b2b/Stytch.mjs.map +1 -1
  279. package/dist/esm/packages/web/src/ui/react/b2b/StytchB2BContext.mjs +1 -1
  280. package/dist/esm/packages/web/src/ui/react/b2b/StytchB2BContext.mjs.map +1 -1
  281. package/dist/esm/packages/web/src/ui/react/b2c/IdentityProvider.mjs +1 -1
  282. package/dist/esm/packages/web/src/ui/react/b2c/IdentityProvider.mjs.map +1 -1
  283. package/dist/esm/packages/web/src/ui/react/b2c/StytchContext.mjs +1 -1
  284. package/dist/esm/packages/web/src/ui/react/b2c/StytchContext.mjs.map +1 -1
  285. package/dist/esm/packages/web/src/ui/react/b2c/StytchLogin.mjs +1 -1
  286. package/dist/esm/packages/web/src/ui/react/b2c/StytchLogin.mjs.map +1 -1
  287. package/dist/esm/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs +1 -1
  288. package/dist/esm/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs.map +1 -1
  289. package/dist/esm/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs +1 -1
  290. package/dist/esm/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs.map +1 -1
  291. package/dist/esm/packages/web/src/ui/react/utils/errors.mjs.map +1 -1
  292. package/dist/esm/packages/web/src/utils/crypto.mjs +15 -14
  293. package/dist/esm/packages/web/src/utils/crypto.mjs.map +1 -1
  294. package/dist/esm/packages/web/src/utils/oauthProviderType.mjs +1 -1
  295. package/dist/esm/packages/web/src/utils/oauthProviderType.mjs.map +1 -1
  296. package/dist/esm-dev/_virtual/index3.mjs +5 -3
  297. package/dist/esm-dev/_virtual/index3.mjs.map +1 -1
  298. package/dist/esm-dev/_virtual/index4.mjs +3 -5
  299. package/dist/esm-dev/_virtual/index4.mjs.map +1 -1
  300. package/dist/esm-dev/b2b/StytchB2BContext.mjs +5 -5
  301. package/dist/esm-dev/b2b/StytchB2BContext.mjs.map +1 -1
  302. package/dist/esm-dev/compat.mjs +3 -0
  303. package/dist/esm-dev/compat.mjs.map +1 -0
  304. package/dist/esm-dev/node_modules/chroma-js/index.mjs +85 -0
  305. package/dist/esm-dev/node_modules/chroma-js/index.mjs.map +1 -0
  306. package/dist/esm-dev/node_modules/chroma-js/src/Color.mjs +53 -0
  307. package/dist/esm-dev/node_modules/chroma-js/src/Color.mjs.map +1 -0
  308. package/dist/esm-dev/node_modules/chroma-js/src/chroma.mjs +11 -0
  309. package/dist/esm-dev/node_modules/chroma-js/src/chroma.mjs.map +1 -0
  310. package/dist/esm-dev/node_modules/chroma-js/src/colors/colorbrewer.mjs +82 -0
  311. package/dist/esm-dev/node_modules/chroma-js/src/colors/colorbrewer.mjs.map +1 -0
  312. package/dist/esm-dev/node_modules/chroma-js/src/colors/w3cx11.mjs +165 -0
  313. package/dist/esm-dev/node_modules/chroma-js/src/colors/w3cx11.mjs.map +1 -0
  314. package/dist/esm-dev/node_modules/chroma-js/src/generator/average.mjs +92 -0
  315. package/dist/esm-dev/node_modules/chroma-js/src/generator/average.mjs.map +1 -0
  316. package/dist/esm-dev/node_modules/chroma-js/src/generator/bezier.mjs +89 -0
  317. package/dist/esm-dev/node_modules/chroma-js/src/generator/bezier.mjs.map +1 -0
  318. package/dist/esm-dev/node_modules/chroma-js/src/generator/blend.mjs +58 -0
  319. package/dist/esm-dev/node_modules/chroma-js/src/generator/blend.mjs.map +1 -0
  320. package/dist/esm-dev/node_modules/chroma-js/src/generator/cubehelix.mjs +93 -0
  321. package/dist/esm-dev/node_modules/chroma-js/src/generator/cubehelix.mjs.map +1 -0
  322. package/dist/esm-dev/node_modules/chroma-js/src/generator/mix.mjs +22 -0
  323. package/dist/esm-dev/node_modules/chroma-js/src/generator/mix.mjs.map +1 -0
  324. package/dist/esm-dev/node_modules/chroma-js/src/generator/random.mjs +16 -0
  325. package/dist/esm-dev/node_modules/chroma-js/src/generator/random.mjs.map +1 -0
  326. package/dist/esm-dev/node_modules/chroma-js/src/generator/scale.mjs +398 -0
  327. package/dist/esm-dev/node_modules/chroma-js/src/generator/scale.mjs.map +1 -0
  328. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/_hsx.mjs +62 -0
  329. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/_hsx.mjs.map +1 -0
  330. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hcg.mjs +13 -0
  331. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hcg.mjs.map +1 -0
  332. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hsi.mjs +13 -0
  333. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hsi.mjs.map +1 -0
  334. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hsl.mjs +13 -0
  335. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hsl.mjs.map +1 -0
  336. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hsv.mjs +13 -0
  337. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/hsv.mjs.map +1 -0
  338. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/index.mjs +4 -0
  339. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/index.mjs.map +1 -0
  340. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/lab.mjs +20 -0
  341. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/lab.mjs.map +1 -0
  342. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/lch.mjs +14 -0
  343. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/lch.mjs.map +1 -0
  344. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/lrgb.mjs +21 -0
  345. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/lrgb.mjs.map +1 -0
  346. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/num.mjs +15 -0
  347. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/num.mjs.map +1 -0
  348. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/oklab.mjs +20 -0
  349. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/oklab.mjs.map +1 -0
  350. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/oklch.mjs +13 -0
  351. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/oklch.mjs.map +1 -0
  352. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/rgb.mjs +19 -0
  353. package/dist/esm-dev/node_modules/chroma-js/src/interpolator/rgb.mjs.map +1 -0
  354. package/dist/esm-dev/node_modules/chroma-js/src/io/cmyk/cmyk2rgb.mjs +18 -0
  355. package/dist/esm-dev/node_modules/chroma-js/src/io/cmyk/cmyk2rgb.mjs.map +1 -0
  356. package/dist/esm-dev/node_modules/chroma-js/src/io/cmyk/index.mjs +29 -0
  357. package/dist/esm-dev/node_modules/chroma-js/src/io/cmyk/index.mjs.map +1 -0
  358. package/dist/esm-dev/node_modules/chroma-js/src/io/cmyk/rgb2cmyk.mjs +20 -0
  359. package/dist/esm-dev/node_modules/chroma-js/src/io/cmyk/rgb2cmyk.mjs.map +1 -0
  360. package/dist/esm-dev/node_modules/chroma-js/src/io/css/css2rgb.mjs +239 -0
  361. package/dist/esm-dev/node_modules/chroma-js/src/io/css/css2rgb.mjs.map +1 -0
  362. package/dist/esm-dev/node_modules/chroma-js/src/io/css/hsl2css.mjs +29 -0
  363. package/dist/esm-dev/node_modules/chroma-js/src/io/css/hsl2css.mjs.map +1 -0
  364. package/dist/esm-dev/node_modules/chroma-js/src/io/css/index.mjs +27 -0
  365. package/dist/esm-dev/node_modules/chroma-js/src/io/css/index.mjs.map +1 -0
  366. package/dist/esm-dev/node_modules/chroma-js/src/io/css/lab2css.mjs +27 -0
  367. package/dist/esm-dev/node_modules/chroma-js/src/io/css/lab2css.mjs.map +1 -0
  368. package/dist/esm-dev/node_modules/chroma-js/src/io/css/lch2css.mjs +27 -0
  369. package/dist/esm-dev/node_modules/chroma-js/src/io/css/lch2css.mjs.map +1 -0
  370. package/dist/esm-dev/node_modules/chroma-js/src/io/css/oklab2css.mjs +18 -0
  371. package/dist/esm-dev/node_modules/chroma-js/src/io/css/oklab2css.mjs.map +1 -0
  372. package/dist/esm-dev/node_modules/chroma-js/src/io/css/oklch2css.mjs +18 -0
  373. package/dist/esm-dev/node_modules/chroma-js/src/io/css/oklch2css.mjs.map +1 -0
  374. package/dist/esm-dev/node_modules/chroma-js/src/io/css/rgb2css.mjs +65 -0
  375. package/dist/esm-dev/node_modules/chroma-js/src/io/css/rgb2css.mjs.map +1 -0
  376. package/dist/esm-dev/node_modules/chroma-js/src/io/gl/index.mjs +24 -0
  377. package/dist/esm-dev/node_modules/chroma-js/src/io/gl/index.mjs.map +1 -0
  378. package/dist/esm-dev/node_modules/chroma-js/src/io/hcg/hcg2rgb.mjs +58 -0
  379. package/dist/esm-dev/node_modules/chroma-js/src/io/hcg/hcg2rgb.mjs.map +1 -0
  380. package/dist/esm-dev/node_modules/chroma-js/src/io/hcg/index.mjs +29 -0
  381. package/dist/esm-dev/node_modules/chroma-js/src/io/hcg/index.mjs.map +1 -0
  382. package/dist/esm-dev/node_modules/chroma-js/src/io/hcg/rgb2hcg.mjs +25 -0
  383. package/dist/esm-dev/node_modules/chroma-js/src/io/hcg/rgb2hcg.mjs.map +1 -0
  384. package/dist/esm-dev/node_modules/chroma-js/src/io/hex/hex2rgb.mjs +57 -0
  385. package/dist/esm-dev/node_modules/chroma-js/src/io/hex/hex2rgb.mjs.map +1 -0
  386. package/dist/esm-dev/node_modules/chroma-js/src/io/hex/index.mjs +30 -0
  387. package/dist/esm-dev/node_modules/chroma-js/src/io/hex/index.mjs.map +1 -0
  388. package/dist/esm-dev/node_modules/chroma-js/src/io/hex/rgb2hex.mjs +33 -0
  389. package/dist/esm-dev/node_modules/chroma-js/src/io/hex/rgb2hex.mjs.map +1 -0
  390. package/dist/esm-dev/node_modules/chroma-js/src/io/hsi/hsi2rgb.mjs +49 -0
  391. package/dist/esm-dev/node_modules/chroma-js/src/io/hsi/hsi2rgb.mjs.map +1 -0
  392. package/dist/esm-dev/node_modules/chroma-js/src/io/hsi/index.mjs +29 -0
  393. package/dist/esm-dev/node_modules/chroma-js/src/io/hsi/index.mjs.map +1 -0
  394. package/dist/esm-dev/node_modules/chroma-js/src/io/hsi/rgb2hsi.mjs +34 -0
  395. package/dist/esm-dev/node_modules/chroma-js/src/io/hsi/rgb2hsi.mjs.map +1 -0
  396. package/dist/esm-dev/node_modules/chroma-js/src/io/hsl/hsl2rgb.mjs +37 -0
  397. package/dist/esm-dev/node_modules/chroma-js/src/io/hsl/hsl2rgb.mjs.map +1 -0
  398. package/dist/esm-dev/node_modules/chroma-js/src/io/hsl/index.mjs +29 -0
  399. package/dist/esm-dev/node_modules/chroma-js/src/io/hsl/index.mjs.map +1 -0
  400. package/dist/esm-dev/node_modules/chroma-js/src/io/hsl/rgb2hsl.mjs +47 -0
  401. package/dist/esm-dev/node_modules/chroma-js/src/io/hsl/rgb2hsl.mjs.map +1 -0
  402. package/dist/esm-dev/node_modules/chroma-js/src/io/hsv/hsv2rgb.mjs +50 -0
  403. package/dist/esm-dev/node_modules/chroma-js/src/io/hsv/hsv2rgb.mjs.map +1 -0
  404. package/dist/esm-dev/node_modules/chroma-js/src/io/hsv/index.mjs +29 -0
  405. package/dist/esm-dev/node_modules/chroma-js/src/io/hsv/index.mjs.map +1 -0
  406. package/dist/esm-dev/node_modules/chroma-js/src/io/hsv/rgb2hsv.mjs +35 -0
  407. package/dist/esm-dev/node_modules/chroma-js/src/io/hsv/rgb2hsv.mjs.map +1 -0
  408. package/dist/esm-dev/node_modules/chroma-js/src/io/input.mjs +7 -0
  409. package/dist/esm-dev/node_modules/chroma-js/src/io/input.mjs.map +1 -0
  410. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/index.mjs +30 -0
  411. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/index.mjs.map +1 -0
  412. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/lab-constants.mjs +116 -0
  413. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/lab-constants.mjs.map +1 -0
  414. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/lab2rgb.mjs +102 -0
  415. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/lab2rgb.mjs.map +1 -0
  416. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/rgb2lab.mjs +68 -0
  417. package/dist/esm-dev/node_modules/chroma-js/src/io/lab/rgb2lab.mjs.map +1 -0
  418. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/hcl2rgb.mjs +11 -0
  419. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/hcl2rgb.mjs.map +1 -0
  420. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/index.mjs +38 -0
  421. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/index.mjs.map +1 -0
  422. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/lab2lch.mjs +15 -0
  423. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/lab2lch.mjs.map +1 -0
  424. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/lch2lab.mjs +21 -0
  425. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/lch2lab.mjs.map +1 -0
  426. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/lch2rgb.mjs +15 -0
  427. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/lch2rgb.mjs.map +1 -0
  428. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/rgb2lch.mjs +14 -0
  429. package/dist/esm-dev/node_modules/chroma-js/src/io/lch/rgb2lch.mjs.map +1 -0
  430. package/dist/esm-dev/node_modules/chroma-js/src/io/named/index.mjs +30 -0
  431. package/dist/esm-dev/node_modules/chroma-js/src/io/named/index.mjs.map +1 -0
  432. package/dist/esm-dev/node_modules/chroma-js/src/io/num/index.mjs +33 -0
  433. package/dist/esm-dev/node_modules/chroma-js/src/io/num/index.mjs.map +1 -0
  434. package/dist/esm-dev/node_modules/chroma-js/src/io/num/num2rgb.mjs +14 -0
  435. package/dist/esm-dev/node_modules/chroma-js/src/io/num/num2rgb.mjs.map +1 -0
  436. package/dist/esm-dev/node_modules/chroma-js/src/io/num/rgb2num.mjs +10 -0
  437. package/dist/esm-dev/node_modules/chroma-js/src/io/num/rgb2num.mjs.map +1 -0
  438. package/dist/esm-dev/node_modules/chroma-js/src/io/oklab/index.mjs +29 -0
  439. package/dist/esm-dev/node_modules/chroma-js/src/io/oklab/index.mjs.map +1 -0
  440. package/dist/esm-dev/node_modules/chroma-js/src/io/oklab/oklab2rgb.mjs +36 -0
  441. package/dist/esm-dev/node_modules/chroma-js/src/io/oklab/oklab2rgb.mjs.map +1 -0
  442. package/dist/esm-dev/node_modules/chroma-js/src/io/oklab/rgb2oklab.mjs +39 -0
  443. package/dist/esm-dev/node_modules/chroma-js/src/io/oklab/rgb2oklab.mjs.map +1 -0
  444. package/dist/esm-dev/node_modules/chroma-js/src/io/oklch/index.mjs +29 -0
  445. package/dist/esm-dev/node_modules/chroma-js/src/io/oklch/index.mjs.map +1 -0
  446. package/dist/esm-dev/node_modules/chroma-js/src/io/oklch/oklch2rgb.mjs +15 -0
  447. package/dist/esm-dev/node_modules/chroma-js/src/io/oklch/oklch2rgb.mjs.map +1 -0
  448. package/dist/esm-dev/node_modules/chroma-js/src/io/oklch/rgb2oklch.mjs +14 -0
  449. package/dist/esm-dev/node_modules/chroma-js/src/io/oklch/rgb2oklch.mjs.map +1 -0
  450. package/dist/esm-dev/node_modules/chroma-js/src/io/rgb/index.mjs +47 -0
  451. package/dist/esm-dev/node_modules/chroma-js/src/io/rgb/index.mjs.map +1 -0
  452. package/dist/esm-dev/node_modules/chroma-js/src/io/temp/index.mjs +23 -0
  453. package/dist/esm-dev/node_modules/chroma-js/src/io/temp/index.mjs.map +1 -0
  454. package/dist/esm-dev/node_modules/chroma-js/src/io/temp/rgb2temperature.mjs +33 -0
  455. package/dist/esm-dev/node_modules/chroma-js/src/io/temp/rgb2temperature.mjs.map +1 -0
  456. package/dist/esm-dev/node_modules/chroma-js/src/io/temp/temperature2rgb.mjs +40 -0
  457. package/dist/esm-dev/node_modules/chroma-js/src/io/temp/temperature2rgb.mjs.map +1 -0
  458. package/dist/esm-dev/node_modules/chroma-js/src/ops/alpha.mjs +14 -0
  459. package/dist/esm-dev/node_modules/chroma-js/src/ops/alpha.mjs.map +1 -0
  460. package/dist/esm-dev/node_modules/chroma-js/src/ops/clipped.mjs +6 -0
  461. package/dist/esm-dev/node_modules/chroma-js/src/ops/clipped.mjs.map +1 -0
  462. package/dist/esm-dev/node_modules/chroma-js/src/ops/darken.mjs +18 -0
  463. package/dist/esm-dev/node_modules/chroma-js/src/ops/darken.mjs.map +1 -0
  464. package/dist/esm-dev/node_modules/chroma-js/src/ops/get.mjs +14 -0
  465. package/dist/esm-dev/node_modules/chroma-js/src/ops/get.mjs.map +1 -0
  466. package/dist/esm-dev/node_modules/chroma-js/src/ops/luminance.mjs +56 -0
  467. package/dist/esm-dev/node_modules/chroma-js/src/ops/luminance.mjs.map +1 -0
  468. package/dist/esm-dev/node_modules/chroma-js/src/ops/mix.mjs +11 -0
  469. package/dist/esm-dev/node_modules/chroma-js/src/ops/mix.mjs.map +1 -0
  470. package/dist/esm-dev/node_modules/chroma-js/src/ops/premultiply.mjs +13 -0
  471. package/dist/esm-dev/node_modules/chroma-js/src/ops/premultiply.mjs.map +1 -0
  472. package/dist/esm-dev/node_modules/chroma-js/src/ops/saturate.mjs +16 -0
  473. package/dist/esm-dev/node_modules/chroma-js/src/ops/saturate.mjs.map +1 -0
  474. package/dist/esm-dev/node_modules/chroma-js/src/ops/set.mjs +44 -0
  475. package/dist/esm-dev/node_modules/chroma-js/src/ops/set.mjs.map +1 -0
  476. package/dist/esm-dev/node_modules/chroma-js/src/ops/shade.mjs +12 -0
  477. package/dist/esm-dev/node_modules/chroma-js/src/ops/shade.mjs.map +1 -0
  478. package/dist/esm-dev/node_modules/chroma-js/src/utils/analyze.mjs +194 -0
  479. package/dist/esm-dev/node_modules/chroma-js/src/utils/analyze.mjs.map +1 -0
  480. package/dist/esm-dev/node_modules/chroma-js/src/utils/clip_rgb.mjs +18 -0
  481. package/dist/esm-dev/node_modules/chroma-js/src/utils/clip_rgb.mjs.map +1 -0
  482. package/dist/esm-dev/node_modules/chroma-js/src/utils/contrast.mjs +15 -0
  483. package/dist/esm-dev/node_modules/chroma-js/src/utils/contrast.mjs.map +1 -0
  484. package/dist/esm-dev/node_modules/chroma-js/src/utils/contrastAPCA.mjs +71 -0
  485. package/dist/esm-dev/node_modules/chroma-js/src/utils/contrastAPCA.mjs.map +1 -0
  486. package/dist/esm-dev/node_modules/chroma-js/src/utils/delta-e.mjs +66 -0
  487. package/dist/esm-dev/node_modules/chroma-js/src/utils/delta-e.mjs.map +1 -0
  488. package/dist/esm-dev/node_modules/chroma-js/src/utils/distance.mjs +20 -0
  489. package/dist/esm-dev/node_modules/chroma-js/src/utils/distance.mjs.map +1 -0
  490. package/dist/esm-dev/node_modules/chroma-js/src/utils/index.mjs +24 -0
  491. package/dist/esm-dev/node_modules/chroma-js/src/utils/index.mjs.map +1 -0
  492. package/dist/esm-dev/node_modules/chroma-js/src/utils/last.mjs +11 -0
  493. package/dist/esm-dev/node_modules/chroma-js/src/utils/last.mjs.map +1 -0
  494. package/dist/esm-dev/node_modules/chroma-js/src/utils/limit.mjs +8 -0
  495. package/dist/esm-dev/node_modules/chroma-js/src/utils/limit.mjs.map +1 -0
  496. package/dist/esm-dev/node_modules/chroma-js/src/utils/multiply-matrices.mjs +39 -0
  497. package/dist/esm-dev/node_modules/chroma-js/src/utils/multiply-matrices.mjs.map +1 -0
  498. package/dist/esm-dev/node_modules/chroma-js/src/utils/scales.mjs +19 -0
  499. package/dist/esm-dev/node_modules/chroma-js/src/utils/scales.mjs.map +1 -0
  500. package/dist/esm-dev/node_modules/chroma-js/src/utils/type.mjs +21 -0
  501. package/dist/esm-dev/node_modules/chroma-js/src/utils/type.mjs.map +1 -0
  502. package/dist/esm-dev/node_modules/chroma-js/src/utils/unpack.mjs +20 -0
  503. package/dist/esm-dev/node_modules/chroma-js/src/utils/unpack.mjs.map +1 -0
  504. package/dist/esm-dev/node_modules/chroma-js/src/utils/valid.mjs +14 -0
  505. package/dist/esm-dev/node_modules/chroma-js/src/utils/valid.mjs.map +1 -0
  506. package/dist/esm-dev/node_modules/chroma-js/src/version.mjs +5 -0
  507. package/dist/esm-dev/node_modules/chroma-js/src/version.mjs.map +1 -0
  508. package/dist/esm-dev/packages/core/src/public/b2b/ui.mjs.map +1 -1
  509. package/dist/esm-dev/packages/core/src/utils/dev.mjs +7 -1
  510. package/dist/esm-dev/packages/core/src/utils/dev.mjs.map +1 -1
  511. package/dist/esm-dev/packages/web/src/adminPortal/utils/theme.mjs +1 -1
  512. package/dist/esm-dev/packages/web/src/ui/b2b/App.mjs +14 -2
  513. package/dist/esm-dev/packages/web/src/ui/b2b/App.mjs.map +1 -1
  514. package/dist/esm-dev/packages/web/src/ui/b2b/components/Icons.mjs +3 -1
  515. package/dist/esm-dev/packages/web/src/ui/b2b/components/Icons.mjs.map +1 -1
  516. package/dist/esm-dev/packages/web/src/ui/b2c/AppContainer.mjs +8 -1
  517. package/dist/esm-dev/packages/web/src/ui/b2c/AppContainer.mjs.map +1 -1
  518. package/dist/esm-dev/packages/web/src/ui/b2c/IDPContainer.mjs +8 -1
  519. package/dist/esm-dev/packages/web/src/ui/b2c/IDPContainer.mjs.map +1 -1
  520. package/dist/esm-dev/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs +8 -1
  521. package/dist/esm-dev/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs.map +1 -1
  522. package/dist/esm-dev/packages/web/src/ui/b2c/ResetPasswordContainer.mjs +8 -1
  523. package/dist/esm-dev/packages/web/src/ui/b2c/ResetPasswordContainer.mjs.map +1 -1
  524. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs +12 -11
  525. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs.map +1 -1
  526. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs +12 -14
  527. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs.map +1 -1
  528. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Secondary/PasswordlessAuthenticate.mjs +6 -2
  529. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Secondary/PasswordlessAuthenticate.mjs.map +1 -1
  530. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Secondary/usePasswordlessAuthenticate.mjs +10 -0
  531. package/dist/esm-dev/packages/web/src/ui/b2c/screens/Secondary/usePasswordlessAuthenticate.mjs.map +1 -1
  532. package/dist/esm-dev/packages/web/src/ui/compat/generateColorFallback.mjs +63 -0
  533. package/dist/esm-dev/packages/web/src/ui/compat/generateColorFallback.mjs.map +1 -0
  534. package/dist/esm-dev/packages/web/src/ui/compat/styleToTheme.mjs +166 -0
  535. package/dist/esm-dev/packages/web/src/ui/compat/styleToTheme.mjs.map +1 -0
  536. package/dist/esm-dev/packages/web/src/ui/components/PresentationConfig.mjs +3 -2
  537. package/dist/esm-dev/packages/web/src/ui/components/PresentationConfig.mjs.map +1 -1
  538. package/dist/esm-dev/packages/web/src/ui/components/atoms/Typography.module.css.mjs +2 -2
  539. package/dist/esm-dev/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs +1 -1
  540. package/dist/esm-dev/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs.map +1 -1
  541. package/dist/esm-dev/packages/web/src/ui/react/b2b/Stytch.mjs +1 -1
  542. package/dist/esm-dev/packages/web/src/ui/react/b2b/Stytch.mjs.map +1 -1
  543. package/dist/esm-dev/packages/web/src/ui/react/b2b/StytchB2BContext.mjs +1 -1
  544. package/dist/esm-dev/packages/web/src/ui/react/b2b/StytchB2BContext.mjs.map +1 -1
  545. package/dist/esm-dev/packages/web/src/ui/react/b2c/IdentityProvider.mjs +1 -1
  546. package/dist/esm-dev/packages/web/src/ui/react/b2c/IdentityProvider.mjs.map +1 -1
  547. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchContext.mjs +1 -1
  548. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchContext.mjs.map +1 -1
  549. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchLogin.mjs +1 -1
  550. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchLogin.mjs.map +1 -1
  551. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs +1 -1
  552. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs.map +1 -1
  553. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs +1 -1
  554. package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs.map +1 -1
  555. package/dist/esm-dev/packages/web/src/ui/react/utils/errors.mjs +8 -4
  556. package/dist/esm-dev/packages/web/src/ui/react/utils/errors.mjs.map +1 -1
  557. package/dist/esm-dev/packages/web/src/utils/crypto.mjs +15 -14
  558. package/dist/esm-dev/packages/web/src/utils/crypto.mjs.map +1 -1
  559. package/dist/esm-dev/packages/web/src/utils/oauthProviderType.mjs +1 -1
  560. package/dist/esm-dev/packages/web/src/utils/oauthProviderType.mjs.map +1 -1
  561. package/dist/types/PresentationConfig-CcNEXkjS.d.ts +172 -0
  562. package/dist/types/{StytchB2BClient-C_7NUKZh.d.ts → StytchB2BClient-D16e_lp1.d.ts} +2 -1
  563. package/dist/types/{StytchClient-Ccvk8Nj1.d.ts → StytchClient-BwQdJzdj.d.ts} +2 -1
  564. package/dist/types/adminPortal/index.d.ts +5 -3
  565. package/dist/types/b2b/index.d.ts +27 -16
  566. package/dist/types/b2b/index.headless.d.ts +5 -4
  567. package/dist/types/compat.d.ts +46 -0
  568. package/dist/types/createAuthUrlHandler-R1kNNQD_.d.ts +2406 -0
  569. package/dist/types/{idpHelpers-aCVwNrDk.d.ts → idpHelpers-BQP76WgZ.d.ts} +1 -1
  570. package/dist/types/index.d.ts +36 -13
  571. package/dist/types/index.headless.d.ts +5 -4
  572. package/dist/types/{shadcn-0e4fkV5Z.d.ts → shadcn-B04UXoBD.d.ts} +10 -169
  573. package/dist/types/{createAuthUrlHandler-BJRA2PHG.d.ts → ui-B7IvSGQf.d.ts} +1123 -3525
  574. package/package.json +1 -1
  575. package/dist/cjs/index-Ni_dyEsz.js.map +0 -1
  576. package/dist/cjs/shadcn-B8TEzQMT.js.map +0 -1
  577. package/dist/cjs-dev/StytchSSRProxy-CxXsyme4.js.map +0 -1
  578. package/dist/cjs-dev/idpHelpers-Cf8Qq1B4.js.map +0 -1
  579. package/dist/cjs-dev/index-DdK3Jt4u.js.map +0 -1
  580. package/dist/cjs-dev/shadcn-C4w3DtKK.js.map +0 -1
@@ -0,0 +1,2406 @@
1
+ import { bs as RNUIProductConfig, bD as StytchSDKError, R as ResponseCommon, b5 as EmailMagicLinksOptions, bb as OAuthOptions, bd as OtpOptions, bf as SessionOptions, be as PasswordOptions, bg as PasskeyOptions, ex as DFPProtectedAuthMode, ey as RBACPolicyRaw, a as StytchProjectConfigurationInput, w as SessionDurationOptions, A as AuthenticateResponse, U as User, ez as Cacheable, x as UnsubscribeFunction, D as DeleteResponse, F as SDKDeviceHistory, cs as B2BAuthenticateResponse, M as MemberSession, y as locale, ct as B2BAuthenticateResponseWithMFA, aq as SessionTokens, eA as IfOpaqueTokens, eB as ExtractOpaqueTokens, ah as SessionAuthenticateOptions, am as SessionRevokeResponse, ar as SessionTokensUpdate, r as Member, z as MemberEmailUpdateDeliveryMethod, co as MemberResponseCommon, eC as Values, G as ConnectedAppPublic, H as ScopeResult } from './ui-B7IvSGQf.js';
2
+
3
+ declare enum EmailSentType {
4
+ LoginOrCreateEML = "login_or_create_eml",
5
+ LoginOrCreateOTP = "login_or_create_otp",
6
+ ResetPassword = "reset_password"
7
+ }
8
+ type AnalyticsEvent = {
9
+ name: 'sdk_instance_instantiated';
10
+ details: {
11
+ event_callback_registered: boolean;
12
+ error_callback_registered: boolean;
13
+ success_callback_registered: boolean;
14
+ };
15
+ } | {
16
+ name: 'b2b_sdk_instance_instantiated';
17
+ details: {
18
+ event_callback_registered: boolean;
19
+ error_callback_registered: boolean;
20
+ success_callback_registered: boolean;
21
+ };
22
+ } | {
23
+ name: 'render_login_screen';
24
+ details: {
25
+ options: CommonLoginConfig | RNUIProductConfig;
26
+ bootstrap: BootstrapData;
27
+ };
28
+ } | {
29
+ name: 'render_b2b_login_screen';
30
+ details: {
31
+ options: CommonB2BLoginConfig;
32
+ bootstrap: BootstrapData;
33
+ };
34
+ } | {
35
+ name: 'render_idp_screen';
36
+ details: {
37
+ bootstrap: BootstrapData;
38
+ };
39
+ } | {
40
+ name: 'render_b2b_idp_screen';
41
+ details: {
42
+ bootstrap: BootstrapData;
43
+ };
44
+ } | {
45
+ name: 'email_sent';
46
+ details: {
47
+ email: string;
48
+ type: EmailSentType;
49
+ };
50
+ } | {
51
+ name: 'email_try_again_clicked';
52
+ details: {
53
+ email: string;
54
+ type: EmailSentType;
55
+ };
56
+ } | {
57
+ name: 'start_oauth_flow';
58
+ details: {
59
+ provider_type: string;
60
+ custom_scopes?: string[];
61
+ cname_domain: string | null;
62
+ pkce: boolean;
63
+ provider_params?: Record<string, string>;
64
+ };
65
+ } | {
66
+ name: 'deeplink_handled_success';
67
+ details: {
68
+ token_type: TokenType;
69
+ };
70
+ } | {
71
+ name: 'deeplink_handled_failure';
72
+ details: {
73
+ error: StytchSDKError | undefined;
74
+ };
75
+ } | {
76
+ name: 'oauth_success';
77
+ details: {
78
+ provider_type: string;
79
+ };
80
+ } | {
81
+ name: 'oauth_failure';
82
+ details: {
83
+ error: StytchSDKError | string | undefined;
84
+ };
85
+ } | {
86
+ name: 'ui_authentication_success';
87
+ details: {
88
+ method: 'oauth' | 'otp' | 'magicLinks' | 'passwords';
89
+ };
90
+ } | {
91
+ name: 'render_b2b_admin_portal_sso';
92
+ details: Record<string, never>;
93
+ } | {
94
+ name: 'render_b2b_admin_portal_org_settings';
95
+ details: Record<string, never>;
96
+ } | {
97
+ name: 'render_b2b_admin_portal_member_management';
98
+ details: Record<string, never>;
99
+ } | {
100
+ name: 'render_b2b_admin_portal_scim';
101
+ details: Record<string, never>;
102
+ };
103
+
104
+ type SDKRequestMethodAndBody = {
105
+ method: 'GET' | 'DELETE';
106
+ body?: null;
107
+ } | {
108
+ method: 'POST' | 'PUT';
109
+ body?: Record<string, unknown>;
110
+ };
111
+ type SDKRequestInfo = SDKRequestMethodAndBody & {
112
+ url: string;
113
+ additionalMetadata?: Record<string, string>;
114
+ };
115
+ interface SDKTelemetry {
116
+ event_id: string;
117
+ app_session_id: string;
118
+ persistent_id: string;
119
+ client_sent_at: string;
120
+ timezone: string;
121
+ app: {
122
+ identifier: string;
123
+ version?: string;
124
+ };
125
+ os?: {
126
+ identifier?: string;
127
+ version?: string;
128
+ };
129
+ device?: {
130
+ model?: string;
131
+ screen_size?: string;
132
+ };
133
+ sdk: {
134
+ identifier: string;
135
+ version: string;
136
+ };
137
+ }
138
+ interface INetworkClient {
139
+ createTelemetryBlob(additionalMetadata?: SDKRequestInfo['additionalMetadata']): SDKTelemetry;
140
+ fetchSDK: <T extends ResponseCommon>(info: SDKRequestInfo) => Promise<T>;
141
+ retriableFetchSDK: <T extends ResponseCommon>(info: RetriableSDKRequestInfo) => Promise<T>;
142
+ logEvent<E extends AnalyticsEvent>({ name, details, error, }: {
143
+ name: E['name'];
144
+ details: E['details'];
145
+ error?: {
146
+ error_code?: string;
147
+ error_description?: string;
148
+ http_status_code?: string;
149
+ };
150
+ }): void;
151
+ updateSessionToken: (sessionToken: string | null) => void;
152
+ }
153
+ type RetriableSDKRequestInfo = SDKRequestInfo & {
154
+ retryCallback: (e: RetriableError, info: SDKBaseRequestInfo) => Promise<SDKBaseRequestInfo>;
155
+ };
156
+ declare enum RetriableErrorType {
157
+ RequiredCaptcha = "CAPTCHA required"
158
+ }
159
+ declare class RetriableError extends Error {
160
+ type: RetriableErrorType;
161
+ constructor(type: RetriableErrorType);
162
+ }
163
+ type SDKBaseRequestInfo = {
164
+ basicAuthHeader: string;
165
+ xSDKClientHeader: string;
166
+ xSDKParentHostHeader?: string;
167
+ body: SDKRequestInfo['body'];
168
+ method: SDKRequestInfo['method'];
169
+ finalURL: string;
170
+ };
171
+
172
+ declare const VERTICAL_B2B = "B2B";
173
+ declare const VERTICAL_CONSUMER = "CONSUMER";
174
+ type Vertical = typeof VERTICAL_B2B | typeof VERTICAL_CONSUMER;
175
+
176
+ type BootstrapData = {
177
+ projectName: string | null;
178
+ displayWatermark: boolean;
179
+ cnameDomain: string | null;
180
+ emailDomains: string[];
181
+ captchaSettings: {
182
+ enabled: false;
183
+ } | {
184
+ enabled: true;
185
+ siteKey: string;
186
+ };
187
+ pkceRequiredForEmailMagicLinks: boolean;
188
+ pkceRequiredForPasswordResets: boolean;
189
+ pkceRequiredForOAuth: boolean;
190
+ pkceRequiredForSso: boolean;
191
+ slugPattern: string | null;
192
+ createOrganizationEnabled: boolean;
193
+ passwordConfig: {
194
+ ludsComplexity: number;
195
+ ludsMinimumCount: number;
196
+ } | null;
197
+ runDFPProtectedAuth: boolean;
198
+ dfpProtectedAuthMode?: DFPProtectedAuthMode;
199
+ rbacPolicy: RBACPolicyRaw | null;
200
+ siweRequiredForCryptoWallets: boolean;
201
+ vertical: Vertical | null;
202
+ };
203
+ /**
204
+ * Internal common config options, excluding platform specific configs like styling and the
205
+ * products array on web. This is just internal to avoid this being exported out and getting
206
+ * confused with the public StytchLoginConfig type
207
+ */
208
+ type CommonLoginConfig = {
209
+ emailMagicLinksOptions?: EmailMagicLinksOptions;
210
+ oauthOptions?: OAuthOptions;
211
+ otpOptions?: OtpOptions;
212
+ sessionOptions?: SessionOptions;
213
+ passwordOptions?: PasswordOptions;
214
+ passkeyOptions?: PasskeyOptions;
215
+ /**
216
+ * The `enableShadowDOM` configuration option allows developers to use the Stytch SDK in a shadow DOM. This defaults to `false`.
217
+ */
218
+ enableShadowDOM?: boolean;
219
+ };
220
+ /**
221
+ * Internal common config options, excluding platform specific configs like styling and the
222
+ * products array on web. This is just internal to avoid this being exported out and getting
223
+ * confused with the public StytchB2BUIConfig type
224
+ */
225
+ type CommonB2BLoginConfig = {
226
+ authFlowType: AuthFlowType;
227
+ sessionOptions: SessionOptions;
228
+ emailMagicLinksOptions?: B2BEmailMagicLinksOptions;
229
+ ssoOptions?: B2BSSOOptions;
230
+ passwordOptions?: B2BPasswordOptions;
231
+ oauthOptions?: B2BOAuthOptions;
232
+ emailOtpOptions?: B2BEmailOTPOptions;
233
+ smsOtpOptions?: B2BSMSOTPOptions;
234
+ /**
235
+ * An optional config that allows you to skip the discover flow and log a member
236
+ * in directly only if they are a member of a single organization.
237
+ */
238
+ directLoginForSingleMembership?: DirectLoginForSingleMembershipConfig;
239
+ /**
240
+ * Whether or not an organization should be created directly when a user has
241
+ * no memberships, invitations, or organizations they could join via JIT
242
+ * provisioning. This has no effect if the ability to create organizations
243
+ * from the frontend SDK is disabled in the Stytch dashboard. Defaults to
244
+ * `false`.
245
+ */
246
+ directCreateOrganizationForNoMembership?: boolean;
247
+ /**
248
+ * Whether to prevent users who are not members of any organization from
249
+ * creating a new organization during the discovery flow. This has no effect
250
+ * if the ability to create organizations from the frontend SDK is disabled in
251
+ * the Stytch dashboard. Defaults to `false`.
252
+ */
253
+ disableCreateOrganization?: boolean;
254
+ /**
255
+ * The order to present MFA products to a member when multiple choices are
256
+ * available, such as during enrollment.
257
+ */
258
+ mfaProductOrder?: readonly B2BMFAProducts[];
259
+ /**
260
+ * MFA products to include in the UI. If specified, the list of available
261
+ * products will be limited to those included. Defaults to all available
262
+ * products.
263
+ *
264
+ * Note that if an organization restricts the available MFA methods, the
265
+ * organization's settings will take precedence. In addition, if a member is
266
+ * enrolled in MFA compatible with their organization's policies, their
267
+ * enrolled methods will always be made available.
268
+ */
269
+ mfaProductInclude?: readonly B2BMFAProducts[];
270
+ /**
271
+ * The slug of the organization to use in the organization-specific auth flow.
272
+ * If not specified, the organization will be inferred from the URL based on
273
+ * the project's configured slug pattern.
274
+ *
275
+ * This has no effect outside of the organization-specific auth flow.
276
+ */
277
+ organizationSlug?: string | null;
278
+ /**
279
+ * The `enableShadowDOM` configuration option allows developers to use the Stytch SDK in a shadow DOM. This defaults to `false`.
280
+ */
281
+ enableShadowDOM?: boolean;
282
+ };
283
+
284
+ type OAuthGetURLOptions = {
285
+ /**
286
+ * The URL that Stytch redirects to after the OAuth flow is completed for a user that already exists.
287
+ * This URL should be an endpoint in the backend server that verifies the request by querying Stytch's /oauth/authenticate endpoint and finishes the login.
288
+ * The URL should be configured as a Login URL in the Stytch Dashboard's Redirect URL page.
289
+ * If the field is not specified, the default in the Dashboard is used.
290
+ */
291
+ login_redirect_url?: string;
292
+ /**
293
+ * The URL that Stytch redirects to after the OAuth flow is completed for a user that does not yet exist.
294
+ * This URL should be an endpoint in the backend server that verifies the request by querying Stytch's /oauth/authenticate endpoint and finishes the login.
295
+ * The URL should be configured as a Sign Up URL in the Stytch Dashboard's Redirect URL page.
296
+ * If the field is not specified, the default in the Dashboard is used.
297
+ */
298
+ signup_redirect_url?: string;
299
+ /**
300
+ * An optional list of custom scopes that you'd like to request from the user in addition to the ones Stytch requests by default.
301
+ * @example Google Custom Scopes
302
+ * ['https://www.googleapis.com/auth/gmail.compose', 'https://www.googleapis.com/auth/firebase']
303
+ *
304
+ * @example Facebook Custom Scopes
305
+ * ['public_profile', 'instagram_shopping_tag_products']
306
+ */
307
+ custom_scopes?: string[];
308
+ /**
309
+ * An optional mapping of provider specific values to pass through to the OAuth provider
310
+ * @example Google authorization parameters
311
+ * {"prompt": "select_account", "login_hint": "example@stytch.com"}
312
+ */
313
+ provider_params?: Record<string, string>;
314
+ /**
315
+ * An optional token to pre-associate an OAuth flow with an existing Stytch User
316
+ */
317
+ oauth_attach_token?: string;
318
+ };
319
+ type OAuthAuthenticateOptions = SessionDurationOptions;
320
+ type OAuthAuthenticateResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = AuthenticateResponse<TProjectConfiguration> & {
321
+ /**
322
+ * The `provider_subject` field is the unique identifier used to identify the user within a given OAuth provider.
323
+ * Also commonly called the "sub" or "Subject field" in OAuth protocols.
324
+ */
325
+ provider_subject: string;
326
+ /**
327
+ * The `type` field denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Facebook, GitHub etc.
328
+ */
329
+ provider_type: string;
330
+ /**
331
+ * If available, the `profile_picture_url` is a url of the user's profile picture set in OAuth identity the provider that the user has authenticated with, e.g. Facebook profile picture.
332
+ */
333
+ profile_picture_url: string;
334
+ /**
335
+ * If available, the `locale` is the user's locale set in the OAuth identity provider that the user has authenticated with.
336
+ */
337
+ locale: string;
338
+ /**
339
+ * The `provider_values` object lists relevant identifiers, values, and scopes for a given OAuth provider.
340
+ * For example this object will include a provider's `access_token` that you can use to access the provider's API for a given user.
341
+ * Note that these values will vary based on the OAuth provider in question, e.g. `id_token` may not be returned by all providers.
342
+ */
343
+ provider_values: {
344
+ /**
345
+ * The `access_token` that you may use to access the user's data in the provider's API.
346
+ */
347
+ access_token: string;
348
+ /**
349
+ * The `id_token` returned by the OAuth provider.
350
+ * ID Tokens are JWTs that contain structured information about a user.
351
+ * The exact content of each ID Token varies from provider to provider.
352
+ * ID Tokens are returned from OAuth providers that conform to the {@link https://openid.net/foundation/ OpenID Connect} specification, which is based on OAuth.
353
+ */
354
+ id_token: string;
355
+ /**
356
+ * The `refresh_token` that you may use to refresh a user's session within the provider's API.
357
+ */
358
+ refresh_token: string;
359
+ /**
360
+ * The OAuth scopes included for a given provider.
361
+ * See each provider's section above to see which scopes are included by default and how to add custom scopes.
362
+ */
363
+ scopes: string[];
364
+ /**
365
+ * The timestamp when the Session expires.
366
+ * Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.
367
+ */
368
+ expires_at: string;
369
+ };
370
+ };
371
+ type OAuthStartFailureReason = 'User Canceled' | 'Authentication Failed' | 'Invalid Platform';
372
+ type OAuthStartResponse = void | {
373
+ success: true;
374
+ } | {
375
+ success: false;
376
+ reason: OAuthStartFailureReason;
377
+ error?: Error;
378
+ };
379
+ /**
380
+ * Methods for interacting with an individual OAuth provider.
381
+ */
382
+ interface IOAuthProvider {
383
+ /**
384
+ * Start an OAuth flow by redirecting the browser to one of Stytch's {@link https://stytch.com/docs/api/oauth-google-start oauth start} endpoints.
385
+ * If enabled, this method will also generate a PKCE code_verifier and store it in localstorage on the device (See the {@link https://stytch.com/docs/oauth#guides_pkce PKCE OAuth guide} for details).
386
+ * If your application is configured to use a custom subdomain with Stytch, it will be used automatically.
387
+ * @example
388
+ * const loginWithGoogle = useCallback(()=> {
389
+ * stytch.oauth.google.start({
390
+ * login_redirect_url: 'https://example.com/oauth/callback',
391
+ * signup_redirect_url: 'https://example.com/oauth/callback',
392
+ * custom_scopes: ['https://www.googleapis.com/auth/gmail.compose']
393
+ * })
394
+ * }, [stytch]);
395
+ * return (
396
+ * <Button onClick={loginWithGoogle}> Log in! </Button>
397
+ * );
398
+ *
399
+ * @param options - An {@link OAuthGetURLOptions} object
400
+ *
401
+ * @returns OAuthStartResponse - In browsers, the browser is redirected during this function call and will return void. You should not attempt to run any code after calling this function. In React Native applications, an external browser is opened, and this method will return the result of the browser/native authentication attempt.
402
+ *
403
+ * @throws A `StytchSDKUsageError` when called with invalid input.
404
+ */
405
+ start(options?: OAuthGetURLOptions): Promise<OAuthStartResponse>;
406
+ }
407
+ type OAuthAttachResponse = ResponseCommon & {
408
+ oauth_attach_token: string;
409
+ };
410
+ interface IHeadlessOAuthClient<TProjectConfiguration extends StytchProjectConfigurationInput> {
411
+ google: IOAuthProvider;
412
+ microsoft: IOAuthProvider;
413
+ apple: IOAuthProvider;
414
+ github: IOAuthProvider;
415
+ gitlab: IOAuthProvider;
416
+ facebook: IOAuthProvider;
417
+ discord: IOAuthProvider;
418
+ salesforce: IOAuthProvider;
419
+ slack: IOAuthProvider;
420
+ amazon: IOAuthProvider;
421
+ bitbucket: IOAuthProvider;
422
+ linkedin: IOAuthProvider;
423
+ coinbase: IOAuthProvider;
424
+ twitch: IOAuthProvider;
425
+ twitter: IOAuthProvider;
426
+ tiktok: IOAuthProvider;
427
+ snapchat: IOAuthProvider;
428
+ figma: IOAuthProvider;
429
+ yahoo: IOAuthProvider;
430
+ /**
431
+ * The authenticate method wraps the {@link https://stytch.com/docs/api/oauth-authenticate authenticate} OAuth API endpoint which validates the OAuth token passed in.
432
+ *
433
+ * @example
434
+ * const token = new URLSearchParams(window.location.search).get('token');
435
+ * stytch.oauth.authenticate(token, {
436
+ * session_duration_minutes: 60
437
+ * }).then(...)
438
+ *
439
+ * @param token - The token to authenticate
440
+ * @param options - {@link OAuthAuthenticateOptions}
441
+ *
442
+ * @returns A {@link OAuthAuthenticateResponse} indicating the token has been authenticated.
443
+ *
444
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
445
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
446
+ * @throws A `StytchSDKUsageError` when called with invalid input.
447
+ */
448
+ authenticate(token: string, options: OAuthAuthenticateOptions): Promise<OAuthAuthenticateResponse<TProjectConfiguration>>;
449
+ /**
450
+ * The attach method wraps the {@link https://stytch.com/docs/api/oauth-attach attach} OAuth API endpoint and generates an OAuth Attach Token to pre-associate an OAuth flow with an existing Stytch User.
451
+ *
452
+ * You must have an active Stytch session to use this endpoint.
453
+ * Pass the returned oauth_attach_token to the same provider's OAuth Start endpoint to treat this OAuth flow as a
454
+ * login for that user instead of a signup
455
+ *
456
+ * @param provider - The OAuth provider's name.
457
+ *
458
+ * @returns A {@link OAuthAttachResponse} containing a single-use token for connecting the Stytch User selection from this request to the corresponding OAuth Start request.
459
+ */
460
+ attach(provider: string): Promise<OAuthAttachResponse>;
461
+ }
462
+
463
+ type UserOnChangeCallback = (user: User | null) => void;
464
+ type UserUpdateOptions = {
465
+ /**
466
+ * The name of the user. If at least one name field is passed, all name fields will be updated.
467
+ */
468
+ name?: {
469
+ /**
470
+ * The first name of the user. Replaces an existing first name, if it exists.
471
+ */
472
+ first_name?: string;
473
+ /**
474
+ * The middle name(s) of the user. Replaces an existing middle name, if it exists.
475
+ */
476
+ middle_name?: string;
477
+ /**
478
+ * The last name of the user. Replaces an existing last name, if it exists.
479
+ */
480
+ last_name?: string;
481
+ };
482
+ /**
483
+ * A JSON object containing application-specific metadata.
484
+ * Use it to store fields that a user can be allowed to edit directly without backend validation - such as `display_theme` or `preferred_locale`.
485
+ * See our {@link https://stytch.com/docs/api/metadata metadata reference} for complete details.
486
+ */
487
+ untrusted_metadata?: Record<string, unknown>;
488
+ };
489
+ type UserUpdateResponse = ResponseCommon & {
490
+ /**
491
+ * Globally unique UUID that identifies a specific user in the Stytch API.
492
+ */
493
+ user_id: string;
494
+ /**
495
+ * The updated emails for the user.
496
+ */
497
+ emails: User['emails'];
498
+ /**
499
+ * The updated phone numbers for the user.
500
+ */
501
+ phone_numbers: User['phone_numbers'];
502
+ /**
503
+ * The updated crypto wallets for the user.
504
+ */
505
+ crypto_wallets: User['crypto_wallets'];
506
+ };
507
+ type UserInfo = Cacheable<{
508
+ /**
509
+ * The user object, or null if no user exists.
510
+ */
511
+ user: User | null;
512
+ }>;
513
+ type UserGetConnectedAppsResponse = ResponseCommon & {
514
+ connected_apps: {
515
+ connected_app_id: string;
516
+ name: string;
517
+ description: string;
518
+ client_type: string;
519
+ logo_url?: string;
520
+ scopes_granted: string;
521
+ }[];
522
+ };
523
+ interface IHeadlessUserClient {
524
+ /**
525
+ * The asynchronous method, `user.get`, wraps the {@link https://stytch.com/docs/api/get-user get user} endpoint.
526
+ * It fetches the user's data and refreshes the cached object if changes are detected.
527
+ * The Stytch SDK will invoke this method automatically in the background, so you probably won't need to call this method directly.
528
+ *
529
+ * @returns A {@link User} object, or null if no user exists.
530
+ *
531
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
532
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
533
+ */
534
+ get(): Promise<User>;
535
+ /**
536
+ * Wraps Stytch's {@link https://stytch.com/docs/api/update-user update user} endpoint. Use this method to change the user's name, untrusted metadata, and attributes.
537
+ *
538
+ * You can listen for successful user updates anywhere in the codebase with the `stytch.user.onChange()` method or `useStytchUser()` hook if you are using React.
539
+ *
540
+ * **Note:** If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk#resources_multi-factor-authentication Multi-factor authentication} section for more details.
541
+ *
542
+ * @example
543
+ * ```
544
+ * const updateName = useCallback(() => {
545
+ * stytchClient.user.update({
546
+ * name: {
547
+ * first_name: 'Jane',
548
+ * last_name: 'Doe',
549
+ * },
550
+ * });
551
+ * }, [stytchClient]);
552
+ * ```
553
+ *
554
+ * @param options - {@link UserUpdateOptions}
555
+ *
556
+ * @returns A {@link UserUpdateResponse} indicating the user has been updated.
557
+ *
558
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
559
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
560
+ * @throws A `StytchSDKUsageError` when called with invalid input.
561
+ */
562
+ update(options: UserUpdateOptions): Promise<UserUpdateResponse>;
563
+ /**
564
+ * The `user.getSync` is a synchronous method for getting a user. This is the recommended approach. You can listen to changes with the `onChange` method.
565
+ * If logged in, this returns the cached user object, otherwise it returns null. This method does not refresh the user's data.
566
+ *
567
+ * @returns A {@link User} object, or null if no user exists.
568
+ *
569
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
570
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
571
+ */
572
+ getSync(): User | null;
573
+ /**
574
+ * The `user.getInfo` method is similar to `user.getSync`, but it returns an object containing the `user` object and a `fromCache` boolean.
575
+ * If `fromCache` is true, the user object is from the cache and a state refresh is in progress.
576
+ */
577
+ getInfo(): UserInfo;
578
+ /**
579
+ * The `user.onChange` method takes in a callback that gets called whenever the user object changes. It returns an unsubscribe method for you to call when you no longer want to listen for such changes.
580
+ *
581
+ * In React, the `@stytch/react` library provides the `useStytchUser` hook that implements these methods for you to easily access the user and listen for changes.
582
+ *
583
+ * @param callback - Gets called whenever the user object changes. See {@link UserOnChangeCallback}.
584
+ *
585
+ * @returns An {@link UnsubscribeFunction} for you to call when you no longer want to listen for changes in the user object.
586
+ *
587
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
588
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
589
+ * @throws A `StytchSDKUsageError` when called with invalid input.
590
+ */
591
+ onChange(callback: UserOnChangeCallback): UnsubscribeFunction;
592
+ /**
593
+ * Wraps Stytch's {@link https://stytch.com/docs/api/delete-user-email delete user email} endpoint.
594
+ * This methods cannot be used to remove all factors from a user. A user must have at least one email, phone number, or OAuth provider associated with their account at all times, otherwise they will not be able to log in again.
595
+ * Note: If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk#resources_multi-factor-authentication Multi-factor authentication} section for more details.
596
+ *
597
+ * @param emailId - ID of the email to be deleted.
598
+ *
599
+ * @returns A {@link DeleteResponse} that indicates the user email has been deleted.
600
+ *
601
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
602
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
603
+ * @throws A `StytchSDKUsageError` when called with invalid input.
604
+ */
605
+ deleteEmail(emailId: string): Promise<DeleteResponse>;
606
+ /**
607
+ * Wraps Stytch's {@link https://stytch.com/docs/api/delete-user-phone-number delete phone number} endpoint.
608
+ * This methods cannot be used to remove all factors from a user. A user must have at least one email, phone number, or OAuth provider associated with their account at all times, otherwise they will not be able to log in again.
609
+ * Note: If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk#resources_multi-factor-authentication Multi-factor authentication} section for more details.
610
+ *
611
+ * @param phoneId - ID of the phone number to be deleted.
612
+ *
613
+ * @returns A {@link DeleteResponse} that indicates the user phone number has been deleted.
614
+ *
615
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
616
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
617
+ * @throws A `StytchSDKUsageError` when called with invalid input.
618
+ */
619
+ deletePhoneNumber(phoneId: string): Promise<DeleteResponse>;
620
+ /**
621
+ * Wraps Stytch's {@link https://stytch.com/docs/api/delete-user-totp delete TOTP} endpoint.
622
+ * Note: If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk#resources_multi-factor-authentication Multi-factor authentication} section for more details.
623
+ *
624
+ * @param totpId - ID of the TOTP registration to be deleted.
625
+ *
626
+ * @returns A {@link DeleteResponse} that indicates the user TOTP registration has been deleted.
627
+ *
628
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
629
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
630
+ * @throws A `StytchSDKUsageError` when called with invalid input.
631
+ */
632
+ deleteTOTP(totpId: string): Promise<DeleteResponse>;
633
+ /**
634
+ * Wraps Stytch's {@link https://stytch.com/docs/api/delete-user-oauth-registration delete OAuth} endpoint.
635
+ * Note: If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk#resources_multi-factor-authentication Multi-factor authentication} section for more details.
636
+ *
637
+ * @param oauthUserRegistrationId - ID of the OAuth registration to be deleted.
638
+ *
639
+ * @returns A {@link DeleteResponse} that indicates the user OAuth registration has been deleted.
640
+ *
641
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
642
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
643
+ * @throws A `StytchSDKUsageError` when called with invalid input.
644
+ */
645
+ deleteOAuthRegistration(oauthUserRegistrationId: string): Promise<DeleteResponse>;
646
+ /**
647
+ * Wraps Stytch's {@link https://stytch.com/docs/api/delete-user-crypto-wallet delete crypto wallet} endpoint.
648
+ * Note: If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk#resources_multi-factor-authentication Multi-factor authentication} section for more details.
649
+ *
650
+ * @param cryptoWalletId - ID of the crypto wallet to be deleted.
651
+ *
652
+ * @returns A {@link DeleteResponse} that indicates the user crypto wallet has been deleted.
653
+ *
654
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
655
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
656
+ * @throws A `StytchSDKUsageError` when called with invalid input.
657
+ */
658
+ deleteCryptoWallet(cryptoWalletId: string): Promise<DeleteResponse>;
659
+ /**
660
+ * Wraps Stytch's {@link https://stytch.com/docs/api/delete-user-webauthn-registration delete WebAuthn} endpoint.
661
+ * Note: If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk#resources_multi-factor-authentication Multi-factor authentication} section for more details.
662
+ *
663
+ * @param webAuthnId - ID of the WebAuthn registration to be deleted.
664
+ *
665
+ * @returns A {@link DeleteResponse} that indicates the user WebAuthn registration has been deleted.
666
+ *
667
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
668
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
669
+ * @throws A `StytchSDKUsageError` when called with invalid input.
670
+ */
671
+ deleteWebauthnRegistration(webAuthnId: string): Promise<DeleteResponse>;
672
+ /**
673
+ * Wraps Stytch's {@link https://stytch.com/docs/api/delete-user-biometric-registration delete biometric} endpoint.
674
+ *
675
+ * @param biometricRegistrationId - ID of the biometric registration to be deleted.
676
+ *
677
+ * @returns A {@link DeleteResponse} that indicates the user Biometric registration has been deleted.
678
+ *
679
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
680
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
681
+ * @throws A `StytchSDKUsageError` when called with invalid input.
682
+ */
683
+ deleteBiometricRegistration(biometricRegistrationId: string): Promise<DeleteResponse>;
684
+ /**
685
+ * The User Get Connected Apps method wraps the {@link https://stytch.com/docs/api/connected-app-user-get-all User Get Connected Apps} API endpoint.
686
+ * The `user_id` will be automatically inferred from the logged-in user's session.
687
+ *
688
+ * This method retrieves a list of Connected Apps that the user has completed an authorization flow with successfully.
689
+ * If the user revokes a Connected App's access (e.g. via the `revokeConnectedApp` method) then the Connected App will
690
+ * no longer be returned in this endpoint's response.
691
+ *
692
+ * @returns A {@link UserGetConnectedAppsResponse} containing a list of the user's connected apps
693
+ *
694
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
695
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
696
+ * @throws A `StytchSDKUsageError` when called with invalid input.
697
+ */
698
+ getConnectedApps(): Promise<UserGetConnectedAppsResponse>;
699
+ /**
700
+ * The User Revoke Connected App method wraps the {@link https://stytch.com/docs/api/connected-app-user-revoke User Revoke Connected App} API endpoint.
701
+ * The `user_id` will be automatically inferred from the logged-in user's session.
702
+ *
703
+ * This method revokes a Connected App's access to the user and revokes all active tokens that have been
704
+ * created on the user's behalf. New tokens cannot be created until the user completes a new authorization
705
+ * flow with the Connected App.
706
+ *
707
+ * Note that after calling this method, the user will be forced to grant consent in subsequent authorization
708
+ * flows with the Connected App.
709
+ *
710
+ * @param connectedAppId - ID of the Connected App to revoke.
711
+ * @returns A {@link ResponseCommon} indicating that the Connected App's access has been revoked.
712
+ *
713
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
714
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
715
+ * @throws A `StytchSDKUsageError` when called with invalid input.
716
+ */
717
+ revokedConnectedApp(connectedAppId: string): Promise<ResponseCommon>;
718
+ }
719
+
720
+ type TOTPCreateOptions = {
721
+ /**
722
+ * The expiration for the TOTP instance. If the newly created TOTP is not authenticated within this time frame the TOTP will be unusable. Defaults to 60 (1 hour) with a minimum of 5 and a maximum of 1440.
723
+ */
724
+ expiration_minutes: number;
725
+ };
726
+ type TOTPCreateResponse = ResponseCommon & {
727
+ /**
728
+ * Globally unique UUID that identifies a specific TOTP registration in the Stytch API.
729
+ */
730
+ totp_id: string;
731
+ /**
732
+ * The TOTP secret key shared between the authenticator app and the server used to generate TOTP codes.
733
+ */
734
+ secret: string;
735
+ /**
736
+ * The QR code image encoded in base64.
737
+ */
738
+ qr_code: string;
739
+ /**
740
+ * The recovery codes used to authenticate the user without an authenticator app.
741
+ */
742
+ recovery_codes: string[];
743
+ };
744
+ type TOTPAuthenticateOptions = SessionDurationOptions & {
745
+ /**
746
+ * The TOTP code to authenticate. The TOTP code should consist of 6 digits.
747
+ */
748
+ totp_code: string;
749
+ };
750
+ type TOTPAuthenticateResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = AuthenticateResponse<TProjectConfiguration> & {
751
+ /**
752
+ * Globally unique UUID that identifies a specific TOTP registration in the Stytch API.
753
+ */
754
+ totp_id: string;
755
+ /**
756
+ * The device history of the user.
757
+ */
758
+ user_device?: SDKDeviceHistory;
759
+ };
760
+ type TOTPRecovery = {
761
+ /**
762
+ * Globally unique UUID that identifies a specific TOTP registration in the Stytch API.
763
+ */
764
+ totp_id: string;
765
+ /**
766
+ * Indicates whether or not the TOTP registration has been verified by the user.
767
+ */
768
+ verified: boolean;
769
+ /**
770
+ * The recovery codes for the TOTP registration.
771
+ */
772
+ recovery_codes: string[];
773
+ };
774
+ type TOTPRecoveryCodesResponse = ResponseCommon & {
775
+ /**
776
+ * Globally unique UUID that identifies a specific user in the Stytch API.
777
+ */
778
+ user_id: string;
779
+ /**
780
+ * See {@link TOTPRecovery}.
781
+ */
782
+ totps: TOTPRecovery;
783
+ };
784
+ type TOTPRecoverOptions = SessionDurationOptions & {
785
+ /**
786
+ * The recovery code to authenticate.
787
+ */
788
+ recovery_code: string;
789
+ };
790
+ type TOTPRecoverResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = AuthenticateResponse<TProjectConfiguration> & {
791
+ /**
792
+ * Globally unique UUID that identifies a specific TOTP registration in the Stytch API.
793
+ */
794
+ totp_id: string;
795
+ /**
796
+ * The device history of the user.
797
+ */
798
+ user_device?: SDKDeviceHistory;
799
+ };
800
+ interface IHeadlessTOTPClient<TProjectConfiguration extends StytchProjectConfigurationInput> {
801
+ /**
802
+ * Wraps Stytch's {@link https://stytch.com/docs/api/totp-create Create} endpoint. Call this method to create a new TOTP instance for a user. The user can use the authenticator application of their choice to scan the QR code or enter the secret.
803
+ *
804
+ * You can listen for successful user updates anywhere in the codebase with the `stytch.user.onChange()` method or `useStytchUser()` hook if you are using React.
805
+ *
806
+ * **Note:** If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk/resources/mfa Multi-factor Authentication} section for more details.
807
+ *
808
+ * @example
809
+ * ```
810
+ * stytchClient.totps.create({ expiration_minutes: 60 });
811
+ * ```
812
+ *
813
+ * @param options - {@link TOTPCreateOptions}
814
+ *
815
+ * @returns A {@link TOTPCreateResponse} indicating a new TOTP instance has been created.
816
+ *
817
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
818
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
819
+ * @throws A `StytchSDKUsageError` when called with invalid input.
820
+ */
821
+ create(options: TOTPCreateOptions): Promise<TOTPCreateResponse>;
822
+ /**
823
+ * Wraps Stytch's {@link https://stytch.com/docs/api/totp-authenticate Authenticate} endpoint. Call this method to authenticate a TOTP code entered by a user.
824
+ *
825
+ * @example
826
+ * ```
827
+ * stytch.totps.authenticate({ totp_code: '123456', session_duration_minutes: 60 });
828
+ * ```
829
+ *
830
+ * @param options - {@link TOTPAuthenticateOptions}
831
+ *
832
+ * @returns A {@link TOTPAuthenticateResponse} indicating the TOTP code has been authenticated.
833
+ *
834
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
835
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
836
+ * @throws A `StytchSDKUsageError` when called with invalid input.
837
+ */
838
+ authenticate(options: TOTPAuthenticateOptions): Promise<TOTPAuthenticateResponse<TProjectConfiguration>>;
839
+ /**
840
+ * Wraps Stytch's {@link https://stytch.com/docs/api/totp-get-recovery-codes Recovery Codes} endpoint. Call this method to retrieve the recovery codes for a TOTP instance tied to a user.
841
+ *
842
+ * You can listen for successful user updates anywhere in the codebase with the `stytch.user.onChange()` method or `useStytchUser()` hook if you are using React.
843
+ *
844
+ * **Note:** If a user has enrolled another MFA method, this method will require MFA. See the {@link https://stytch.com/docs/sdks/javascript-sdk/resources/mfa Multi-factor authentication} section for more details.
845
+ *
846
+ * @example
847
+ * ```
848
+ * stytchClient.totps.recoveryCodes();
849
+ * ```
850
+ *
851
+ * @returns A {@link TOTPRecoveryCodesResponse} containing the TOTP recovery codes tied to the user.
852
+ *
853
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
854
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
855
+ */
856
+ recoveryCodes(): Promise<TOTPRecoveryCodesResponse>;
857
+ /**
858
+ * Wraps Stytch's {@link https://stytch.com/docs/api/totp-recover Recover} endpoint. Call this method to authenticate a recovery code for a TOTP instance.
859
+ *
860
+ * @example
861
+ * ```
862
+ * stytch.totps.recover({ recovery_code: 'xxxx-xxxx-xxxx', session_duration_minutes: 60 });
863
+ * ```
864
+ *
865
+ * @param options - {@link TOTPRecoverOptions}
866
+ *
867
+ * @returns A {@link TOTPRecoverResponse} indicating the TOTP recovery code has been authenticated.
868
+ *
869
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
870
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
871
+ * @throws A `StytchSDKUsageError` when called with invalid input.
872
+ */
873
+ recover(options: TOTPRecoverOptions): Promise<TOTPRecoverResponse<TProjectConfiguration>>;
874
+ }
875
+
876
+ type B2BSessionAuthenticateResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = B2BAuthenticateResponse<TProjectConfiguration>;
877
+ type B2BSessionRevokeOptions = {
878
+ /**
879
+ * When true, clear the user and session object in the local storage, even in the event of a network failure revoking the session.
880
+ * When false, the user and session object will not be cleared in the event that the SDK cannot contact the Stytch servers.
881
+ * The user and session object will always be cleared when the session revoke call succeeds.
882
+ * Defaults to false
883
+ */
884
+ forceClear?: boolean;
885
+ };
886
+ type B2BSessionRevokeForMemberOptions = {
887
+ /**
888
+ * The ID of the Member whose sessions should be revoked.
889
+ */
890
+ member_id: string;
891
+ };
892
+ type B2BSessionRevokeForMemberResponse = ResponseCommon;
893
+ type B2BSessionOnChangeCallback = (session: MemberSession | null) => void;
894
+ type B2BSessionExchangeOptions = SessionDurationOptions & {
895
+ /**
896
+ * The ID of the organization that the new session should belong to.
897
+ */
898
+ organization_id: string;
899
+ /**
900
+ * The locale will be used if an OTP code is sent to the member's phone number as part of a
901
+ * secondary authentication requirement.
902
+ */
903
+ locale?: locale;
904
+ };
905
+ type B2BSessionExchangeResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = B2BAuthenticateResponseWithMFA<TProjectConfiguration>;
906
+ type B2BSessionAccessTokenExchangeOptions = SessionDurationOptions & {
907
+ /**
908
+ * The Connected Apps access token.
909
+ */
910
+ access_token: string;
911
+ };
912
+ type B2BSessionAccessTokenExchangeResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = B2BAuthenticateResponse<TProjectConfiguration>;
913
+ type MemberSessionInfo = Cacheable<{
914
+ /**
915
+ * The session object, or null if no session exists.
916
+ */
917
+ session: MemberSession | null;
918
+ }>;
919
+ type B2BSessionAttestOptions = SessionDurationOptions & {
920
+ /**
921
+ * The ID of the organization that the new session should belong to.
922
+ */
923
+ organization_id?: string;
924
+ /**
925
+ * The ID of the token profile used to validate the JWT string.
926
+ */
927
+ profile_id: string;
928
+ /**
929
+ * JWT string.
930
+ */
931
+ token: string;
932
+ } & Partial<SessionTokens>;
933
+ type B2BSessionAttestResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = B2BAuthenticateResponse<TProjectConfiguration>;
934
+ interface IHeadlessB2BSessionClient<TProjectConfiguration extends StytchProjectConfigurationInput> {
935
+ /**
936
+ * If logged in, the `session.getSync` method returns the cached session object. Otherwise it returns `null`.
937
+ *
938
+ * @example
939
+ * const memberSession = stytch.session.getSync();
940
+ * @returns The user's active {@link MemberSession} object or `null`
941
+ */
942
+ getSync(): MemberSession | null;
943
+ /**
944
+ * The `session.getInfo` method is similar to `session.getSync`, but it returns an object containing the `session` object and a `fromCache` boolean.
945
+ * If `fromCache` is true, the session object is from the cache and a state refresh is in progress.
946
+ */
947
+ getInfo(): MemberSessionInfo;
948
+ /**
949
+ * Returns the `session_token` and `session_jwt` values associated with the logged-in user's active session.
950
+ *
951
+ * Session tokens are only available if:
952
+ * - There is an active session, and
953
+ * - The session is _not_ managed via HttpOnly cookies.
954
+ *
955
+ * If either of these conditions is not met, `getTokens` will return `null`.
956
+ *
957
+ * Note that the Stytch SDK stores the `session_token` and `session_jwt` values as session cookies in the user's browser.
958
+ * Those cookies will be automatically included in any request that your frontend makes to a service (such as your backend) that shares the domain set on the cookies, so in most cases, you will not need to explicitly retrieve the `session_token` and `session_jwt` values using the `getTokens()` method.
959
+ * However, we offer this method to serve some unique use cases where explicitly retrieving the tokens may be necessary.
960
+ *
961
+ * @example
962
+ * const {session_jwt} = stytch.session.getTokens();
963
+ * fetch('https://api.example.com, {
964
+ * headers: new Headers({
965
+ * 'Authorization': 'Bearer ' + session_jwt,
966
+ * credentials: 'include',
967
+ * }),
968
+ * })
969
+ *
970
+ */
971
+ getTokens(): IfOpaqueTokens<ExtractOpaqueTokens<TProjectConfiguration>, never, SessionTokens | null>;
972
+ /**
973
+ * The `session.onChange` method takes in a callback that gets called whenever the Member Session object changes.
974
+ * It returns an unsubscribe method for you to call when you no longer want to listen for such changes.
975
+ *
976
+ * The `useStytchMemberSession` hook is available in `@stytch/react` or `@stytch/nextjs`. It implements these methods for you to easily access the session and listen for changes.
977
+ * @example
978
+ * stytch.session.onChange((memberSession) => {
979
+ * if(!memberSession) {
980
+ * // The member has been logged out!
981
+ * window.location.href = 'https://example.com/login'
982
+ * }
983
+ * })
984
+ * @param callback - {@link B2BSessionOnChangeCallback}
985
+ */
986
+ onChange(callback: B2BSessionOnChangeCallback): UnsubscribeFunction;
987
+ /**
988
+ * Wraps Stytch's {@link https://stytch.com/docs/b2b/api/authenticate-session authenticate } Session endpoint and validates that the session issued to the user is still valid.
989
+ * The SDK will invoke this method automatically in the background. You probably won't need to call this method directly.
990
+ * It's recommended to use `session.getSync` and `session.onChange` instead.
991
+ * @example
992
+ * stytch.session.authenticate({
993
+ * // Extend the session for another 60 minutes
994
+ * session_duration_minutes: 60
995
+ * })
996
+ * @param options - {@link SessionAuthenticateOptions}
997
+ * @returns A {@link B2BSessionAuthenticateResponse} object
998
+ */
999
+ authenticate(options?: SessionAuthenticateOptions): Promise<B2BSessionAuthenticateResponse<TProjectConfiguration>>;
1000
+ /**
1001
+ * Wraps Stytch's {@link https://stytch.com/docs/b2b/api/revoke-session revoke} Session endpoint and revokes the user's current session.
1002
+ * This method should be used to log out a user. While calling this method, we clear the user and session objects from local storage
1003
+ * unless the SDK cannot contact the Stytch servers. This behavior can be overriden by using the optional param object.
1004
+ *
1005
+ * @param options - {@link B2BSessionRevokeOptions}
1006
+ *
1007
+ * @example
1008
+ * stytch.session.revoke()
1009
+ * .then(() => window.location.href = 'https://example.com/login');
1010
+ * @returns A {@link SessionRevokeResponse}
1011
+ */
1012
+ revoke(options?: B2BSessionRevokeOptions): Promise<SessionRevokeResponse>;
1013
+ /**
1014
+ * Wraps Stytch's {@link https://stytch.com/docs/b2b/api/revoke-session revoke} Session endpoint and revokes all Sessions for a given Member.
1015
+ *
1016
+ * @rbac action="revoke-sessions", resource="stytch.member"
1017
+ *
1018
+ * @param options - {@link B2BSessionRevokeForMemberOptions}
1019
+ *
1020
+ * @example
1021
+ * stytch.session.revokeForMember({ member_id: 'member-id-123' });
1022
+ * @returns A {@link B2BSessionRevokeForMemberResponse}
1023
+ */
1024
+ revokeForMember(options: B2BSessionRevokeForMemberOptions): Promise<B2BSessionRevokeForMemberResponse>;
1025
+ /**
1026
+ * Update a user's session tokens to hydrate a front-end session from the backend.
1027
+ * For example, if you log your users in with one of our backend SDKs, you can pass the resulting `session_token` and `session_jwt` to this method to prime the frontend SDK with a valid set of tokens.
1028
+ * You must then make an {@link https://stytch.com/docs/api/session-auth authenticate} call to authenticate the session tokens and retrieve the user's current session.
1029
+ *
1030
+ * @param tokens - The session tokens to update to
1031
+ */
1032
+ updateSession(tokens: SessionTokensUpdate): void;
1033
+ /**
1034
+ * Wraps Stytch's {@link https://stytch.com/docs/b2b/api/exchange-session Exchange Session} endpoint and exchanges the member's current session for a session in the specified Organization.
1035
+ * @example
1036
+ * stytch.session.exchange({
1037
+ * organization_id: 'organization-123',
1038
+ * session_duration_minutes: 60
1039
+ * })
1040
+ * @param options - {@link B2BSessionExchangeOptions}
1041
+ * @returns A {@link B2BSessionExchangeResponse}
1042
+ */
1043
+ exchange(options: B2BSessionExchangeOptions): Promise<B2BSessionExchangeResponse<TProjectConfiguration>>;
1044
+ /**
1045
+ * Wraps Stytch's {@link https://stytch.com/docs/b2b/api/connected-app-access-token-exchange Exchange Access Token} endpoint and exchanges a Connected Apps token for a Session for the original Member.
1046
+ * @example
1047
+ * stytch.session.exchangeAccessToken({
1048
+ * access_token: 'eyJh...',
1049
+ * session_duration_minutes: 60
1050
+ * })
1051
+ * @param options - {@link B2BSessionExchangeOptions}
1052
+ * @returns A {@link B2BSessionExchangeResponse}
1053
+ */
1054
+ exchangeAccessToken(options: B2BSessionAccessTokenExchangeOptions): Promise<B2BSessionAccessTokenExchangeResponse<TProjectConfiguration>>;
1055
+ /**
1056
+ * Wraps Stytch's {@link https://stytch.com/docs/b2b/api/attest-session Attest} Session endpoint and gets a Stytch session from a trusted JWT.
1057
+ * @example
1058
+ * stytch.session.attest({
1059
+ * organization_id: 'organization-123',
1060
+ * profile_id: 'profile-123',
1061
+ * token: 'eyJh...',
1062
+ * session_duration_minutes: 60
1063
+ * })
1064
+ * @param data - {@link B2BSessionAttestOptions}
1065
+ * @returns A {@link B2BSessionAttestResponse}
1066
+ */
1067
+ attest(data: B2BSessionAttestOptions): Promise<B2BSessionAttestResponse<TProjectConfiguration>>;
1068
+ }
1069
+
1070
+ type B2BMemberOnChangeCallback = (member: Member | null) => void;
1071
+ type B2BMemberUpdateOptions = {
1072
+ /**
1073
+ * The name of the Member. Replaces the existing name, if it exists.
1074
+ */
1075
+ name?: string;
1076
+ /**
1077
+ * A JSON object containing application-specific metadata.
1078
+ * Use it to store fields that a Member can be allowed to edit directly without backend validation - such as `display_theme` or `preferred_locale`.
1079
+ * See our {@link https://stytch.com/docs/api/metadata metadata reference} for complete details.
1080
+ */
1081
+ untrusted_metadata?: Record<string, unknown>;
1082
+ /**
1083
+ * Sets whether the Member is enrolled in MFA.
1084
+ * If true, the Member must complete an MFA step whenever they wish to log in to their Organization.
1085
+ * If false, the Member only needs to complete an MFA step if the Organization's MFA policy is set to REQUIRED_FOR_ALL.
1086
+ */
1087
+ mfa_enrolled?: boolean;
1088
+ /**
1089
+ * Sets the Member's phone number. Throws an error if the Member already has a phone number.
1090
+ */
1091
+ mfa_phone_number?: string;
1092
+ /**
1093
+ * Sets the Member's default MFA method. Valid values are 'sms_otp' and 'totp'.
1094
+ * This value will determine
1095
+ * 1. Which MFA method the Member is prompted to use when logging in
1096
+ * 2. Whether An SMS will be sent automatically after completing the first leg of authentication
1097
+ */
1098
+ default_mfa_method?: 'sms_otp' | 'totp';
1099
+ };
1100
+ type B2BMemberUnlinkRetiredEmailRequest = {
1101
+ /**
1102
+ * ID of the retired email to be deleted. At least one of email id or email address must be provided.
1103
+ */
1104
+ email_id?: string;
1105
+ /**
1106
+ * Address of the retired email to be deleted. At least one of email id or email address must be provided.
1107
+ */
1108
+ email_address?: string;
1109
+ };
1110
+ type B2BMemberStartEmailUpdateRequest = {
1111
+ /**
1112
+ * The new email address to be set (after verification) for the Member.
1113
+ */
1114
+ email_address: string;
1115
+ /**
1116
+ * The url the user is redirected to after clicking the login email magic link.
1117
+ * This should be a url that your app receives and parses and subsequently send an API request to authenticate the magic link and log in the member.
1118
+ * If this value is not passed, the default login redirect URL that you set in your Dashboard is used.
1119
+ * If you have not set a default login redirect URL, an error is returned.
1120
+ */
1121
+ login_redirect_url?: string;
1122
+ /**
1123
+ * The email template ID to use for magic linkemails.
1124
+ * If not provided, your default email template will be sent. If providing a template ID, it must be either a template using Stytch's customizations,
1125
+ * or a Magic link Login custom HTML template.
1126
+ */
1127
+ login_template_id?: string;
1128
+ /**
1129
+ * The locale is used to determine which language to use in the email. Parameter is a {@link https://www.w3.org/International/articles/language-tags/ IETF BCP 47 language tag}, e.g. "en".
1130
+ * Currently supported languages are English ("en"), Spanish ("es"), and Brazilian Portuguese ("pt-br"); if no value is provided, the copy defaults to English.
1131
+ */
1132
+ locale?: locale;
1133
+ /**
1134
+ * The delivery method to use when sending the email, either EMAIL_MAGIC_LINK or EMAIL_OTP. By default, EMAIL_MAGIC_LINK is used.
1135
+ */
1136
+ delivery_method?: MemberEmailUpdateDeliveryMethod;
1137
+ };
1138
+ type B2BMemberStartEmailUpdateResponse = MemberResponseCommon;
1139
+ type B2BMemberGetConnectedAppsResponse = ResponseCommon & {
1140
+ connected_apps: {
1141
+ connected_app_id: string;
1142
+ name: string;
1143
+ description: string;
1144
+ client_type: string;
1145
+ logo_url?: string;
1146
+ scopes_granted: string;
1147
+ }[];
1148
+ };
1149
+ type B2BMemberRevokeConnectedAppOptions = {
1150
+ connected_app_id: string;
1151
+ };
1152
+ type B2BMemberRevokeConnectedAppResponse = ResponseCommon;
1153
+ type B2BMemberUpdateResponse = MemberResponseCommon;
1154
+ type B2BMemberDeleteMFAPhoneNumberResponse = MemberResponseCommon;
1155
+ type B2BMemberDeletePasswordResponse = MemberResponseCommon;
1156
+ type B2BMemberDeleteMFATOTPResponse = MemberResponseCommon;
1157
+ type B2BMemberUnlinkRetiredEmailResponse = MemberResponseCommon;
1158
+ type MemberInfo = Cacheable<{
1159
+ /**
1160
+ * The member object, or null if no member exists.
1161
+ */
1162
+ member: Member | null;
1163
+ }>;
1164
+ interface IHeadlessB2BSelfClient {
1165
+ /**
1166
+ * The asynchronous method, `member.get`, wraps the {@link https://stytch.com/docs/b2b/api/search-members search member} endpoint.
1167
+ * It fetches the Member's data and refreshes the cached object if changes are detected.
1168
+ * The Stytch SDK will invoke this method automatically in the background, so you probably won't need to call this method directly.
1169
+ *
1170
+ * @returns A {@link Member} object, or null if no member exists.
1171
+ *
1172
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1173
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1174
+ */
1175
+ get(): Promise<Member | null>;
1176
+ /**
1177
+ * If logged in, the `member.getSync` method returns the cached Member object.
1178
+ * Otherwise it returns `null`.
1179
+ * This method does not refresh the Member's data.
1180
+ *
1181
+ * @returns A {@link Member} object, or null if no user exists.
1182
+ *
1183
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1184
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1185
+ */
1186
+ getSync(): Member | null;
1187
+ /**
1188
+ * The `member.getInfo` method is similar to `member.getSync`, but it returns an object containing the `member` object and a `fromCache` boolean.
1189
+ * If `fromCache` is true, the Member object is from the cache and a state refresh is in progress.
1190
+ */
1191
+ getInfo(): MemberInfo;
1192
+ /**
1193
+ * The `member.onChange` method takes in a callback that gets called whenever the Member object changes.
1194
+ * It returns an unsubscribe method for you to call when you no longer want to listen for such changes.
1195
+ *
1196
+ * @param callback - Gets called whenever the member object changes. See {@link B2BMemberOnChangeCallback}.
1197
+ *
1198
+ * @returns An {@link UnsubscribeFunction} for you to call when you no longer want to listen for changes in the member object.
1199
+ *
1200
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1201
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1202
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1203
+ */
1204
+ onChange(callback: B2BMemberOnChangeCallback): UnsubscribeFunction;
1205
+ /**
1206
+ * The Update Member method wraps the {@link https://stytch.com/docs/b2b/api/update-member Update Member} API endpoint.
1207
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1208
+ * This method can be used to update any Member in the logged-in Member's Organization.
1209
+ *
1210
+ * See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk/members#update-self Stytch Docs} for a complete reference.
1211
+ *
1212
+ * @example
1213
+ * stytch.self.update({
1214
+ * mfa_enrolled: true,
1215
+ * phone_number: '+12025550162',
1216
+ * });
1217
+ *
1218
+ * @rbac action="requested", resource="stytch.self"
1219
+ *
1220
+ * @param data - {@link B2BMemberUpdateOptions}
1221
+ *
1222
+ * @returns A {@link B2BMemberUpdateResponse} indicating that the member has been updated.
1223
+ *
1224
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1225
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1226
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1227
+ */
1228
+ update(data: B2BMemberUpdateOptions): Promise<B2BMemberUpdateResponse>;
1229
+ /**
1230
+ * The Delete Self MFA phone number method wraps the {@link https://stytch.com/docs/b2b/api/delete-member-mfa-phone-number Delete Member MFA phone number} API endpoint.
1231
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1232
+ * This method can only be used to delete the logged-in Member's MFA phone number.
1233
+ *
1234
+ * To change a Member's phone number, you must first call this endpoint to delete the existing phone number.
1235
+ *
1236
+ * See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk/members#delete-self-mfa-phone-number Stytch Docs} for a complete reference.
1237
+ *
1238
+ * @rbac action="update.info.delete.mfa-phone", resource="stytch.self"
1239
+ *
1240
+ * @returns A {@link B2BMemberDeleteMFAPhoneNumberResponse} indicating that the member's phone number has been deleted.
1241
+ *
1242
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1243
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1244
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1245
+ */
1246
+ deleteMFAPhoneNumber(): Promise<B2BMemberDeleteMFAPhoneNumberResponse>;
1247
+ /**
1248
+ * The Delete Self password method wraps the {@link https://stytch.com/docs/b2b/api/delete-member-password Delete Member password} API endpoint.
1249
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1250
+ * This method can only be used to delete the logged-in Member's password.
1251
+ *
1252
+ * See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk/members#delete-self-password Stytch Docs} for a complete reference.
1253
+ *
1254
+ * @rbac action="update.info.delete.password", resource="stytch.self"
1255
+ *
1256
+ * @returns A {@link B2BMemberDeletePasswordResponse} indicating that the member's phone number has been deleted.
1257
+ *
1258
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1259
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1260
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1261
+ */
1262
+ deletePassword(passwordId: string): Promise<B2BMemberDeletePasswordResponse>;
1263
+ /**
1264
+ * The Delete Self MFA totp method wraps the {@link https://stytch.com/docs/b2b/api/delete-member-mfa-totp Delete Member MFA TOTP} API endpoint.
1265
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1266
+ * This method can only be used to delete the logged-in Member's MFA totp.
1267
+ *
1268
+ * To change a Member's totp, you must first call this endpoint to delete the existing totp.
1269
+ *
1270
+ * See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk/members#delete-self-mfa-totp Stytch Docs} for a complete reference.
1271
+ *
1272
+ * @rbac action="update.info.delete.mfa-totp", resource="stytch.self"
1273
+ *
1274
+ * @returns A {@link B2BMemberDeleteMFATOTPResponse} indicating that the member's totp has been deleted.
1275
+ *
1276
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1277
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1278
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1279
+ */
1280
+ deleteMFATOTP(): Promise<B2BMemberDeleteMFATOTPResponse>;
1281
+ /**
1282
+ * The Unlink Self Retired Email Address method wraps the {@link https://stytch.com/docs/b2b/api/unlink-retired-member-email Unlink Retired Email} API endpoint.
1283
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1284
+ * This method can only be used to unlink the logged-in Member's retired email.
1285
+ *
1286
+ * See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk/members#unlink-retired-member-email Stytch Docs} for a complete reference.
1287
+ *
1288
+ * @rbac action="update.info.unlink.retired-email", resource="stytch.self"
1289
+ *
1290
+ * @param data - {@link B2BMemberUnlinkRetiredEmailRequest}
1291
+ * @returns A {@link B2BMemberUnlinkRetiredEmailResponse} indicating that the member's retired email has been marked as deleted.
1292
+ *
1293
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1294
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1295
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1296
+ */
1297
+ unlinkRetiredEmail(data: B2BMemberUnlinkRetiredEmailRequest): Promise<B2BMemberUnlinkRetiredEmailResponse>;
1298
+ /**
1299
+ * The Start Email Update method wraps the {@link https://stytch.com/docs/b2b/api/start-member-email-update Start Member Email Update} API endpoint.
1300
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1301
+ * This method can be used to start the self-serve email update process for the logged-in Member.
1302
+ *
1303
+ * See the {@link https://stytch.com/docs/b2b/sdks/members/start-self-email-update Stytch Docs} for a complete reference.
1304
+ *
1305
+ * @rbac action="update.info.email", resource="stytch.self"
1306
+ *
1307
+ * @param data - {@link B2BMemberStartEmailUpdateRequest}
1308
+ * @returns A {@link B2BMemberStartEmailUpdateResponse} indicating that an email update has been started.
1309
+ *
1310
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1311
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1312
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1313
+ */
1314
+ startEmailUpdate(data: B2BMemberStartEmailUpdateRequest): Promise<B2BMemberStartEmailUpdateResponse>;
1315
+ /**
1316
+ * The Member Get Connected Apps method wraps the {@link https://stytch.com/docs/b2b/api/connected-app-member-get-all Member Get Connected Apps} API endpoint.
1317
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1318
+ *
1319
+ * This method retrieves a list of Connected Apps that the Member has completed an authorization flow with successfully.
1320
+ * If the Member revokes a Connected App's access (e.g. via the `revokeConnectedApp` method) then the Connected App will
1321
+ * no longer be returned in this endpoint's response. A Connected App's access may be revoked if the Organization's
1322
+ * allowed Connected App policy changes.
1323
+ *
1324
+ * See the {@link https://stytch.com/docs/b2b/sdks/members/get-self-connected-apps Stytch Docs} for a complete reference.
1325
+ *
1326
+ * @rbac action="get.connected-apps", resource="stytch.self"
1327
+ *
1328
+ * @returns A {@link B2BMemberGetConnectedAppsResponse} indicating that the member's retired email has been marked as deleted.
1329
+ *
1330
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1331
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1332
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1333
+ */
1334
+ getConnectedApps(): Promise<B2BMemberGetConnectedAppsResponse>;
1335
+ /**
1336
+ * The Member Revoke Connected App method wraps the {@link https://stytch.com/docs/b2b/api/connected-app-member-revoke Member Revoke Connected App} API endpoint.
1337
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1338
+ *
1339
+ * This method revokes a Connected App's access to the Member and revokes all active tokens that have been
1340
+ * created on the Member's behalf. New tokens cannot be created until the Member completes a new authorization
1341
+ * flow with the Connected App.
1342
+ *
1343
+ * Note that after calling this method, the Member will be forced to grant consent in subsequent authorization
1344
+ * flows with the Connected App.
1345
+ *
1346
+ * See the {@link https://stytch.com/docs/b2b/sdks/members/revoke-self-connected-app Stytch Docs} for a complete reference.
1347
+ *
1348
+ * @rbac action="revoke.connected-app", resource="stytch.self"
1349
+ *
1350
+ * @param data - {@link B2BMemberRevokeConnectedAppOptions}
1351
+ * @returns A {@link B2BMemberRevokeConnectedAppResponse} indicating that the Connected App's access has been revoked.
1352
+ *
1353
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1354
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1355
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1356
+ */
1357
+ revokeConnectedApp(data: B2BMemberRevokeConnectedAppOptions): Promise<B2BMemberRevokeConnectedAppResponse>;
1358
+ }
1359
+ /**
1360
+ * @deprecated please use IHeadlessB2BSelfClient
1361
+ */
1362
+ interface IHeadlessB2BMemberClient {
1363
+ /**
1364
+ * The asynchronous method, `member.get`, wraps the {@link https://stytch.com/docs/b2b/api/search-members Search Member} endpoint.
1365
+ * It fetches the Member's data and refreshes the cached object if changes are detected.
1366
+ * The Stytch SDK will invoke this method automatically in the background, so you probably won't need to call this method directly.
1367
+ *
1368
+ * @deprecated please use {@link IHeadlessB2BSelfClient#get self.get()} instead
1369
+ * @returns A {@link Member} object, or null if no member exists.
1370
+ *
1371
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1372
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1373
+ */
1374
+ get(): Promise<Member | null>;
1375
+ /**
1376
+ * If logged in, the `member.getSync` method returns the cached Member object.
1377
+ * Otherwise it returns `null`. This method does not refresh the Member's data.
1378
+ * The synchronous method for getting a member. This is the recommended approach.
1379
+ *
1380
+ * @deprecated please use {@link IHeadlessB2BSelfClient#get self.getSync()} instead
1381
+ * @returns A {@link Member} object, or null if no user exists.
1382
+ *
1383
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1384
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1385
+ */
1386
+ getSync(): Member | null;
1387
+ /**
1388
+ * The `member.onChange` method takes in a callback that gets called whenever the Member object changes.
1389
+ * It returns an unsubscribe method for you to call when you no longer want to listen for such changes.
1390
+ *
1391
+ * @deprecated please use {@link IHeadlessB2BSelfClient#get self.onChange()} instead
1392
+ * @param callback - Gets called whenever the member object changes. See {@link B2BMemberOnChangeCallback}.
1393
+ *
1394
+ * @returns An {@link UnsubscribeFunction} for you to call when you no longer want to listen for changes in the member object.
1395
+ *
1396
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1397
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1398
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1399
+ */
1400
+ onChange(callback: B2BMemberOnChangeCallback): UnsubscribeFunction;
1401
+ /**
1402
+ * The Update Self method wraps the {@link https://stytch.com/docs/b2b/api/update-member Update Member} API endpoint.
1403
+ * The `organization_id` and `member_id` will be automatically inferred from the logged-in Member's session.
1404
+ * This method can be used to update only the logged-in Member.
1405
+ *
1406
+ * See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk/members#update-member-deprecated Stytch Docs} for a complete reference.
1407
+ *
1408
+ * @example
1409
+ * stytch.self.update({
1410
+ * mfa_enrolled: true,
1411
+ * phone_number: '+12025550162',
1412
+ * });
1413
+ *
1414
+ * @deprecated please use {@link IHeadlessB2BSelfClient#get self.update()} instead
1415
+ * @param data - {@link B2BMemberUpdateOptions}
1416
+ *
1417
+ * @returns A {@link B2BMemberUpdateResponse} indicating that the member has been updated.
1418
+ *
1419
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1420
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1421
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1422
+ */
1423
+ update(data: B2BMemberUpdateOptions): Promise<B2BMemberUpdateResponse>;
1424
+ /**
1425
+ * The Delete Member MFA phone number method wraps the {@link https://stytch.com/docs/b2b/api/delete-member-mfa-phone-number Delete Member MFA phone number} API endpoint.
1426
+ * Use this method to delete the Member's MFA phone number.
1427
+ *
1428
+ * To change a Member's phone number, you must first call this endpoint to delete the existing phone number.
1429
+ *
1430
+ * @deprecated please use {@link IHeadlessB2BSelfClient#get self.deleteMFAPhoneNumber()} instead
1431
+ * @returns A {@link B2BMemberDeleteMFAPhoneNumberResponse} indicating that the member's phone number has been deleted.
1432
+ *
1433
+ * @throws A `StytchSDKAPIError` when the Stytch API returns an error.
1434
+ * @throws A `SDKAPIUnreachableError` when the SDK cannot contact the Stytch API.
1435
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1436
+ */
1437
+ deleteMFAPhoneNumber(): Promise<B2BMemberDeleteMFAPhoneNumberResponse>;
1438
+ }
1439
+
1440
+ /**
1441
+ * The authentication methods we support through our UI.
1442
+ * Currently we support `emailMagicLinks`, `emailOtp`, `sso`, `passwords`, and `oauth`.
1443
+ */
1444
+ declare const AuthFlowType: {
1445
+ readonly Discovery: "Discovery";
1446
+ readonly Organization: "Organization";
1447
+ readonly PasswordReset: "PasswordReset";
1448
+ };
1449
+ type AuthFlowType = Values<typeof AuthFlowType>;
1450
+ declare const RedirectURLType: {
1451
+ readonly ResetPassword: "reset_password";
1452
+ };
1453
+ type RedirectURLType = Values<typeof RedirectURLType>;
1454
+ /**
1455
+ * The OAuth providers we support in our B2B OAuth product.
1456
+ */
1457
+ declare const B2BOAuthProviders: {
1458
+ readonly Google: "google";
1459
+ readonly Microsoft: "microsoft";
1460
+ readonly HubSpot: "hubspot";
1461
+ readonly Slack: "slack";
1462
+ readonly GitHub: "github";
1463
+ };
1464
+ type B2BOAuthProviders = Values<typeof B2BOAuthProviders>;
1465
+ /**
1466
+ * The options for email magic links. This is used if you've enabled the `emailMagicLinks` product
1467
+ * in your configuration.
1468
+ */
1469
+ type B2BEmailMagicLinksOptions = {
1470
+ loginRedirectURL?: string;
1471
+ signupRedirectURL?: string;
1472
+ discoveryRedirectURL?: string;
1473
+ loginTemplateId?: string;
1474
+ signupTemplateId?: string;
1475
+ /**
1476
+ * @param domainHint - An optional hint indicating what domain the email will be sent from.
1477
+ * This field is only required if your project uses more than one custom domain to send emails.
1478
+ */
1479
+ domainHint?: string;
1480
+ locale?: string;
1481
+ };
1482
+ /**
1483
+ * The options for SSO. This is used if you've enabled the `sso` product
1484
+ * in your configuration.
1485
+ */
1486
+ type B2BSSOOptions = {
1487
+ loginRedirectURL?: string;
1488
+ signupRedirectURL?: string;
1489
+ };
1490
+ /**
1491
+ * The options for OAuth. This is required if you've enabled the `oauth` product
1492
+ * in your configuration.
1493
+ */
1494
+ type B2BOAuthOptions = {
1495
+ loginRedirectURL?: string;
1496
+ signupRedirectURL?: string;
1497
+ discoveryRedirectURL?: string;
1498
+ /** @deprecated Use customScopes in B2BOAuthProviderConfig instead */
1499
+ customScopes?: string[];
1500
+ providers: B2BOAuthProviderConfig[];
1501
+ /** @deprecated Use providerParams in B2BOAuthProviderConfig instead */
1502
+ providerParams?: Record<string, string>;
1503
+ locale?: string;
1504
+ };
1505
+ /**
1506
+ * Details about the OAuth provider you wish to use. Each B2BOAuthProviderConfig object can be either a plain
1507
+ * B2BOAuthProviders string (e.g. 'google'), or an object with a type key that determines the type of provider. For
1508
+ * Google OAuth, you can optionally specify the one_tap property to display Google One Tap.
1509
+ */
1510
+ type B2BOAuthProviderConfig = B2BOAuthProviders | {
1511
+ type: typeof B2BOAuthProviders.Google;
1512
+ customScopes?: string[];
1513
+ providerParams?: Record<string, string>;
1514
+ one_tap?: boolean;
1515
+ /**
1516
+ * Whether to cancel the One Tap prompt when the user taps outside of it.
1517
+ * This is only applicable if one_tap is true.
1518
+ */
1519
+ cancel_on_tap_outside?: boolean;
1520
+ } | {
1521
+ type: Exclude<B2BOAuthProviders, typeof B2BOAuthProviders.Google>;
1522
+ customScopes?: string[];
1523
+ providerParams?: Record<string, string>;
1524
+ };
1525
+ /**
1526
+ * The options for Passwords. This is used if you've enabled the `passwords` product
1527
+ * in your configuration.
1528
+ */
1529
+ type B2BPasswordOptions = {
1530
+ loginRedirectURL?: string;
1531
+ resetPasswordRedirectURL?: string;
1532
+ resetPasswordExpirationMinutes?: number;
1533
+ resetPasswordTemplateId?: string;
1534
+ discoveryRedirectURL?: string;
1535
+ verifyEmailTemplateId?: string;
1536
+ locale?: string;
1537
+ };
1538
+ type B2BEmailOTPOptions = {
1539
+ loginTemplateId?: string;
1540
+ signupTemplateId?: string;
1541
+ locale?: string;
1542
+ };
1543
+ type B2BSMSOTPOptions = {
1544
+ locale?: string;
1545
+ };
1546
+ type DirectLoginForSingleMembershipConfig = {
1547
+ /**
1548
+ * Whether or not direct login for single membership is enabled.
1549
+ */
1550
+ status: boolean;
1551
+ /**
1552
+ * If enabled, logs user in directly even if they have pending invite to a different organization
1553
+ */
1554
+ ignoreInvites: boolean;
1555
+ /**
1556
+ * If enabled, logs user in directly even if they have organizations they could join via JIT provisioning
1557
+ */
1558
+ ignoreJitProvisioning: boolean;
1559
+ };
1560
+ declare const B2BMFAProducts: {
1561
+ readonly smsOtp: "smsOtp";
1562
+ readonly totp: "totp";
1563
+ };
1564
+ type B2BMFAProducts = Values<typeof B2BMFAProducts>;
1565
+
1566
+ type Actions$1<Actions extends string> = Record<Actions, boolean>;
1567
+ type PermissionsMap<Permissions extends Record<string, string>> = {
1568
+ [ResourceID in keyof Permissions]: Actions$1<Permissions[ResourceID]>;
1569
+ };
1570
+ interface IHeadlessB2BRBACClient {
1571
+ /**
1572
+ * The `isAuthorizedSync` method determines whether the logged-in member is allowed to perform the specified action on the specified resource.
1573
+ * Returns `true` if the member can perform the action, `false` otherwise.
1574
+ *
1575
+ * If the member is not logged in, or the RBAC policy has not been loaded, this method will always return false.
1576
+ * If the resource or action provided are not valid for the configured RBAC policy, this method will return false.
1577
+ * @example
1578
+ * const isAuthorized = stytch.rbac.isAuthorizedSync<Permissions>('document', 'image');
1579
+ */
1580
+ isAuthorizedSync(resourceId: string, action: string): boolean;
1581
+ /**
1582
+ * The `isAuthorized` method determines whether the logged-in member is allowed to perform the specified action on the specified resource.
1583
+ * It will return a Promise that resolves after the RBAC policy has been loaded. Returns `true` if the member can perform the action, `false` otherwise.
1584
+ *
1585
+ * If the member is not logged in, this method will always return false.
1586
+ * If the resource or action provided are not valid for the configured RBAC policy, this method will return false.
1587
+ *
1588
+ * @example
1589
+ * const isAuthorized = await stytch.rbac.isAuthorizedSync<Permissions>('document', 'image');
1590
+ */
1591
+ isAuthorized(resourceId: string, action: string): Promise<boolean>;
1592
+ /**
1593
+ * The `allPermissions` method returns the complete list of permissions assigned to the currently logged-in Member. If the Member is not logged in, all values will be `false`.
1594
+ *
1595
+ * As a best practice, authorization checks for sensitive actions should also occur on the backend.
1596
+ *
1597
+ * @example
1598
+ * type Permissions = {
1599
+ * document: 'create' | 'read' | 'write
1600
+ * image: 'create' | 'read'
1601
+ * }
1602
+ * const permissions = await stytch.rbac.allPermissions<Permissions>();
1603
+ * console.log(permissions.document.create) // true
1604
+ * console.log(permissions.image.create) // false
1605
+ * @returns A {@link PermissionsMap} for the active member
1606
+ */
1607
+ allPermissions<Permissions extends Record<string, string>>(): Promise<PermissionsMap<Permissions>>;
1608
+ }
1609
+
1610
+ interface BaseSCIMConnection {
1611
+ /**
1612
+ * Globally unique UUID that identifies a specific Organization.
1613
+ */
1614
+ organization_id: string;
1615
+ /**
1616
+ * Globally unique UUID that identifies a specific SCIM Connection.
1617
+ */
1618
+ connection_id: string;
1619
+ /**
1620
+ * The status of the connection. The possible values are deleted or active.
1621
+ */
1622
+ status: string;
1623
+ /**
1624
+ * A human-readable display name for the connection.
1625
+ */
1626
+ display_name: string;
1627
+ /**
1628
+ * The identity provider of this connection.
1629
+ */
1630
+ identity_provider: string;
1631
+ /**
1632
+ * The base URL of the SCIM connection.
1633
+ */
1634
+ base_url: string;
1635
+ /**
1636
+ * An array of implicit group role assignments granted to members in this organization who are provisioned this SCIM connection
1637
+ * and belong to the specified group.
1638
+ * See our {@link https://stytch.com/docs/b2b/guides/rbac/role-assignment RBAC guide} for more information about
1639
+ * role assignment.
1640
+ */
1641
+ scim_group_implicit_role_assignments: {
1642
+ role_id: string;
1643
+ group_id: string;
1644
+ }[];
1645
+ }
1646
+ interface SCIMConnection extends BaseSCIMConnection {
1647
+ /**
1648
+ * Last four characters of the issued bearer token.
1649
+ */
1650
+ bearer_token_last_four: string;
1651
+ /**
1652
+ * The time at which the bearer token expires.
1653
+ */
1654
+ bearer_token_expires_at: string;
1655
+ /**
1656
+ * Present during rotation, the next bearer token's last four digits.
1657
+ */
1658
+ next_bearer_token_last_four?: string;
1659
+ /**
1660
+ * Present during rotation, the time at which the next bearer token expires.
1661
+ */
1662
+ next_bearer_token_expires_at?: string;
1663
+ }
1664
+ interface SCIMConnectionWithBearerToken extends BaseSCIMConnection {
1665
+ /**
1666
+ * The bearer token used to authenticate with the SCIM API.
1667
+ */
1668
+ bearer_token: string;
1669
+ /**
1670
+ * The time at which the bearer token expires.
1671
+ */
1672
+ bearer_token_expires_at: string;
1673
+ }
1674
+ interface SCIMConnectionWithNextBearerToken extends BaseSCIMConnection {
1675
+ /**
1676
+ * The bearer token used to authenticate with the SCIM API.
1677
+ */
1678
+ next_bearer_token: string;
1679
+ /**
1680
+ * The time at which the bearer token expires.
1681
+ */
1682
+ next_bearer_token_expires_at: string;
1683
+ /**
1684
+ * Last four characters of the issued bearer token.
1685
+ */
1686
+ bearer_token_last_four: string;
1687
+ /**
1688
+ * The time at which the bearer token expires.
1689
+ */
1690
+ bearer_token_expires_at: string;
1691
+ }
1692
+ interface SCIMGroup {
1693
+ /**
1694
+ * Globally unique UUID that identifies a specific Organization.
1695
+ */
1696
+ organization_id: string;
1697
+ /**
1698
+ * Globally unique UUID that identifies a specific SCIM Connection.
1699
+ */
1700
+ connection_id: string;
1701
+ /**
1702
+ * Globally unique UUID that identifies a specific SCIM Group.
1703
+ */
1704
+ group_id: string;
1705
+ /**
1706
+ * Name given to the group by the IDP.
1707
+ */
1708
+ group_name: string;
1709
+ }
1710
+ type B2BSCIMCreateConnectionOptions = {
1711
+ /**
1712
+ * A human-readable display name for the connection.
1713
+ */
1714
+ display_name?: string;
1715
+ /**
1716
+ * The identity provider of this connection.
1717
+ */
1718
+ identity_provider?: string;
1719
+ };
1720
+ type B2BSCIMCreateConnectionResponse = ResponseCommon & {
1721
+ connection: SCIMConnectionWithBearerToken;
1722
+ };
1723
+ type B2BSCIMUpdateConnectionOptions = {
1724
+ /**
1725
+ * Globally unique UUID that identifies a specific SCIM Connection.
1726
+ */
1727
+ connection_id: string;
1728
+ /**
1729
+ * A human-readable display name for the connection.
1730
+ */
1731
+ display_name?: string;
1732
+ /**
1733
+ * The identity provider of this connection.
1734
+ */
1735
+ identity_provider?: string;
1736
+ /**
1737
+ * An array of implicit role assignments granted to members in this organization who are created via this SCIM connection
1738
+ * and belong to the specified group.
1739
+ * Before adding any group implicit role assignments, you must first provision groups from your IdP into Stytch,
1740
+ * see our {@link https://stytch.com/docs/b2b/guides/scim/overview scim-guide}.
1741
+ * See our {@link https://stytch.com/docs/b2b/guides/rbac/role-assignment RBAC guide} for more information about
1742
+ * role assignment.
1743
+ */
1744
+ scim_group_implicit_role_assignments?: {
1745
+ role_id: string;
1746
+ group_id: string;
1747
+ }[];
1748
+ };
1749
+ type B2BSCIMUpdateConnectionResponse = ResponseCommon & {
1750
+ connection: SCIMConnection;
1751
+ };
1752
+ type B2BSCIMDeleteConnectionResponse = ResponseCommon & {
1753
+ /**
1754
+ * Globally unique UUID that identifies a specific SCIM Connection.
1755
+ */
1756
+ connection_id: string;
1757
+ };
1758
+ type B2BSCIMGetConnectionResponse = ResponseCommon & {
1759
+ connection: SCIMConnection;
1760
+ };
1761
+ type B2BSCIMGetConnectionGroupsOptions = {
1762
+ /**
1763
+ * The maximum number of groups that should be returned by the API.
1764
+ */
1765
+ limit?: number;
1766
+ /**
1767
+ * The cursor to use to indicate where to start group results.
1768
+ */
1769
+ cursor?: string;
1770
+ };
1771
+ type B2BSCIMGetConnectionGroupsResponse = ResponseCommon & {
1772
+ /**
1773
+ * List of SCIM Groups for the connection.
1774
+ */
1775
+ scim_groups: SCIMGroup[];
1776
+ /**
1777
+ * The cursor to use to get the next page of results.
1778
+ */
1779
+ next_cursor: string | null;
1780
+ };
1781
+ type B2BSCIMRotateStartResponse = ResponseCommon & {
1782
+ connection: SCIMConnectionWithNextBearerToken;
1783
+ };
1784
+ type B2BSCIMRotateCompleteResponse = ResponseCommon & {
1785
+ connection: SCIMConnection;
1786
+ };
1787
+ type B2BSCIMRotateCancelResponse = ResponseCommon & {
1788
+ connection: SCIMConnection;
1789
+ };
1790
+ interface IHeadlessB2BSCIMClient {
1791
+ /**
1792
+ * The Create SCIM Connection method wraps the {@link https://stytch.com/docs/b2b/api/create-scim-connection Create SCIM Connection} API endpoint.
1793
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1794
+ * This method cannot be used to create SCIM connections in other Organizations.
1795
+ *
1796
+ * @example
1797
+ * stytch.scim.createConnection({
1798
+ * display_name: 'My SCIM Connection',
1799
+ * identity_provider: 'okta'
1800
+ * });
1801
+ *
1802
+ * @rbac action="create", resource="stytch.scim"
1803
+ *
1804
+ * @param data - {@link B2BSCIMCreateConnectionOptions}
1805
+ *
1806
+ * returns A {@link B2BSCIMCreateConnectionResponse} indicating that the SCIM connection has been created.
1807
+ *
1808
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1809
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1810
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1811
+ */
1812
+ createConnection(data: B2BSCIMCreateConnectionOptions): Promise<B2BSCIMCreateConnectionResponse>;
1813
+ /**
1814
+ * Updates an existing SCIM connection.
1815
+ * This method wraps the {@link https://stytch.com/docs/b2b/api/update-scim-connection update-connection} endpoint.
1816
+ * If attempting to modify the `scim_group_implicit_role_assignments` the caller must have the `update.settings.implicit-roles` permission on the `stytch.organization` resource.
1817
+ * For all other fields, the caller must have the `update` permission on the `stytch.scim` resource.
1818
+ * SCIM via the project's RBAC policy & their role assignments.
1819
+ *
1820
+ * @example
1821
+ * stytch.scim.updateConnection({
1822
+ * connection_id: 'connection-id-123',
1823
+ * display_name: 'My SCIM Connection',
1824
+ * identity_provider: 'okta',
1825
+ * scim_group_implicit_role_assignments: [
1826
+ * {
1827
+ * group_id: 'group-id-123',
1828
+ * role_id: 'role-id-123'
1829
+ * }
1830
+ * ]
1831
+ * });
1832
+ *
1833
+ * @rbac action="update", resource="stytch.scim"
1834
+ *
1835
+ * @param data - {@link B2BSCIMUpdateConnectionOptions}
1836
+ *
1837
+ * returns A {@link B2BSCIMUpdateConnectionResponse} indicating that the SCIM connection has been updated.
1838
+ *
1839
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1840
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1841
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1842
+ */
1843
+ updateConnection(data: B2BSCIMUpdateConnectionOptions): Promise<B2BSCIMUpdateConnectionResponse>;
1844
+ /**
1845
+ * The Delete SCIM Connection method wraps the {@link https://stytch.com/docs/b2b/api/delete-scim-connection Delete SCIM Connection} API endpoint.
1846
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1847
+ * This method cannot be used to delete SCIM connections in other Organizations.
1848
+ *
1849
+ * @example
1850
+ * stytch.scim.deleteConnection('connection-id-123');
1851
+ *
1852
+ * @rbac action="delete", resource="stytch.scim"
1853
+ *
1854
+ * @param connectionId
1855
+ *
1856
+ * returns A {@link B2BSCIMDeleteConnectionResponse} indicating that the SCIM connection has been deleted.
1857
+ *
1858
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1859
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1860
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1861
+ */
1862
+ deleteConnection(connectionId: string): Promise<B2BSCIMDeleteConnectionResponse>;
1863
+ /**
1864
+ * The Get SCIM Connection method wraps the {@link https://stytch.com/docs/b2b/api/get-scim-connection Get SCIM Connection} API endpoint.
1865
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1866
+ * This method cannot be used to get SCIM connection from other Organizations.
1867
+ *
1868
+ * @example
1869
+ * stytch.scim.getConnection();
1870
+ *
1871
+ * @rbac action="get", resource="stytch.scim"
1872
+ *
1873
+ * @param connectionId
1874
+ *
1875
+ * returns A {@link B2BSCIMGetConnectionResponse} indicating that the SCIM connection has been retrieved.
1876
+ *
1877
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1878
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1879
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1880
+ */
1881
+ getConnection(connectionId: string): Promise<B2BSCIMGetConnectionResponse>;
1882
+ /**
1883
+ * The Get SCIM Connection Groups method wraps the {@link https://stytch.com/docs/b2b/api/get-scim-connection-groups Get SCIM Connection} API endpoint.
1884
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1885
+ *
1886
+ * @example
1887
+ * stytch.scim.getConnectionGroups({
1888
+ * limit: 10
1889
+ * });
1890
+ *
1891
+ * @rbac action="get", resource="stytch.scim"
1892
+ *
1893
+ * @param data
1894
+ */
1895
+ getConnectionGroups(data: B2BSCIMGetConnectionGroupsOptions): Promise<B2BSCIMGetConnectionGroupsResponse>;
1896
+ /**
1897
+ * The SCIM Rotate Token Start method wraps the {@link https://stytch.com/docs/b2b/api/scim-rotate-token-start SCIM Rotate Token Start} API endpoint.
1898
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1899
+ * This method cannot be used to start token rotations for SCIM connections in other Organizations.
1900
+ *
1901
+ * @example
1902
+ * stytch.scim.rotateStart('connection-id-123');
1903
+ *
1904
+ * @rbac action="update", resource="stytch.scim"
1905
+ *
1906
+ * @param connectionId
1907
+ *
1908
+ * returns A {@link B2BSCIMRotateStartResponse} containing a new bearer token
1909
+ *
1910
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1911
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1912
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1913
+ */
1914
+ rotateStart(connectionId: string): Promise<B2BSCIMRotateStartResponse>;
1915
+ /**
1916
+ * The SCIM Rotate Token Complete method wraps the {@link https://stytch.com/docs/b2b/api/scim-rotate-token-complete SCIM Rotate Token Complete} API endpoint.
1917
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1918
+ * This method cannot be used to complete token rotations for SCIM connections in other Organizations.
1919
+ *
1920
+ * @example
1921
+ * stytch.scim.rotateComplete('connection-id-123');
1922
+ *
1923
+ * @rbac action="update", resource="stytch.scim"
1924
+ *
1925
+ * @param connectionId
1926
+ *
1927
+ * returns A {@link B2BSCIMRotateCompleteResponse} containing a new bearer token
1928
+ *
1929
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1930
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1931
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1932
+ */
1933
+ rotateComplete(connectionId: string): Promise<B2BSCIMRotateCompleteResponse>;
1934
+ /**
1935
+ * The SCIM Rotate Token Cancel method wraps the {@link https://stytch.com/docs/b2b/api/scim-rotate-token-cancel SCIM Rotate Token Cancel} API endpoint.
1936
+ * The `organization_id` will be automatically inferred from the logged-in Member's session.
1937
+ * This method cannot be used to cancel token rotations for SCIM connections in other Organizations.
1938
+ *
1939
+ * @example
1940
+ * stytch.scim.rotateCancel('connection-id-123');
1941
+ *
1942
+ * @rbac action="update", resource="stytch.scim"
1943
+ *
1944
+ * @param connectionId
1945
+ *
1946
+ * returns A {@link B2BSCIMRotateCancelResponse} containing a new bearer token
1947
+ *
1948
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
1949
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
1950
+ * @throws A `StytchSDKUsageError` when called with invalid input.
1951
+ */
1952
+ rotateCancel(connectionId: string): Promise<B2BSCIMRotateCancelResponse>;
1953
+ }
1954
+
1955
+ type B2BOAuthAuthorizeStartOptions = {
1956
+ client_id: string;
1957
+ redirect_uri: string;
1958
+ response_type: string;
1959
+ scopes: string[];
1960
+ prompt?: string;
1961
+ };
1962
+ type B2BOAuthAuthorizeStartResponse = ResponseCommon & {
1963
+ client: ConnectedAppPublic;
1964
+ consent_required: boolean;
1965
+ scope_results: ScopeResult[];
1966
+ };
1967
+ type B2BOAuthAuthorizeSubmitOptions = {
1968
+ client_id: string;
1969
+ redirect_uri: string;
1970
+ response_type: string;
1971
+ scopes: string[];
1972
+ state?: string;
1973
+ nonce?: string;
1974
+ code_challenge?: string;
1975
+ consent_granted: boolean;
1976
+ prompt?: string;
1977
+ };
1978
+ type B2BOAuthAuthorizeSubmitResponse = ResponseCommon & {
1979
+ redirect_uri: string;
1980
+ authorization_code?: string;
1981
+ };
1982
+ type B2BOAuthLogoutStartOptions = {
1983
+ client_id: string;
1984
+ post_logout_redirect_uri: string;
1985
+ state: string;
1986
+ id_token_hint?: string;
1987
+ };
1988
+ type B2BOAuthLogoutStartResponse = ResponseCommon & {
1989
+ redirect_uri: string;
1990
+ consent_required: boolean;
1991
+ };
1992
+ interface IHeadlessB2BIDPClient {
1993
+ /**
1994
+ * Initiates a request for authorization of a Connected App to access a Member's account.
1995
+ *
1996
+ * Call this endpoint using the query parameters from an OAuth Authorization request. This endpoint validates various fields (scope, client_id, redirect_uri, prompt, etc...) are correct and returns relevant information for rendering an OAuth Consent Screen.
1997
+ *
1998
+ * @example
1999
+ * const response = await stytch.idp.oauthAuthorizeStart({
2000
+ * client_id: 'client_123',
2001
+ * redirect_uri: 'https://example.com/callback',
2002
+ * scope: 'openid email profile',
2003
+ * });
2004
+ */
2005
+ oauthAuthorizeStart(data: B2BOAuthAuthorizeStartOptions): Promise<B2BOAuthAuthorizeStartResponse>;
2006
+ /**
2007
+ * Completes a request for authorization of a Connected App to access a Member's account.
2008
+ *
2009
+ * Call this endpoint using the query parameters from an OAuth Authorization request, after previously validating those parameters using the Preflight Check API. Note that this endpoint takes in a few additional parameters the preflight check does not- state, nonce, and code_challenge.
2010
+ *
2011
+ * If the authorization was successful, the redirect_uri will contain a valid authorization_code embedded as a query parameter. If the authorization was unsuccessful, the redirect_uri will contain an OAuth2.1 error_code. In both cases, redirect the Member to the location for the response to be consumed by the Connected App.
2012
+ *
2013
+ * Exactly one of the following must be provided to identify the Member granting authorization:
2014
+ * organization_id + member_id
2015
+ * session_token
2016
+ * session_jwt
2017
+ *
2018
+ * If a session_token or session_jwt is passed, the OAuth Authorization will be linked to the Member's session for tracking purposes. One of these fields must be used if the Connected App intends to complete the Exchange Access Token flow.
2019
+ *
2020
+ * @example
2021
+ * const response = await stytch.idp.oauthAuthorizeSubmit({
2022
+ * client_id: 'client_123',
2023
+ * redirect_uri: 'https://example.com/callback',
2024
+ * scope: 'openid email profile',
2025
+ * });
2026
+ */
2027
+ oauthAuthorizeSubmit(data: B2BOAuthAuthorizeSubmitOptions): Promise<B2BOAuthAuthorizeSubmitResponse>;
2028
+ }
2029
+
2030
+ type BiometricsRegisterOptions = {
2031
+ /**
2032
+ * The text rendered when raising the biometric prompt.
2033
+ */
2034
+ prompt: string;
2035
+ /**
2036
+ * The text rendered on the cancel button when raising the biometric prompt. Defaults to "Cancel".
2037
+ */
2038
+ cancelButtonText?: string;
2039
+ /**
2040
+ * On Android devices, allow the private key data to be stored as cleartext in the application sandbox.
2041
+ */
2042
+ allowFallbackToCleartext?: boolean;
2043
+ /**
2044
+ * Allows user to enter their device credentials as a fallback for failed biometric authentication.
2045
+ */
2046
+ allowDeviceCredentials?: boolean;
2047
+ /**
2048
+ * Specify the desired session duration, in minutes
2049
+ */
2050
+ sessionDurationMinutes?: number;
2051
+ };
2052
+ type BiometricsRegisterStartResponse = ResponseCommon & {
2053
+ /**
2054
+ * A unique ID that identifies a specific biometric registration.
2055
+ */
2056
+ biometric_registration_id: string;
2057
+ /**
2058
+ * The challenge to be signed by the device.
2059
+ */
2060
+ challenge: string;
2061
+ };
2062
+ type BiometricsRegisterCompleteResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = AuthenticateResponse<TProjectConfiguration> & {
2063
+ /**
2064
+ * A unique ID that identifies a specific biometric registration.
2065
+ */
2066
+ biometric_registration_id: string;
2067
+ };
2068
+ type BiometricsAuthenticateOptions = {
2069
+ /**
2070
+ * The text rendered when raising the biometric prompt.
2071
+ */
2072
+ prompt: string;
2073
+ /**
2074
+ * Set the session lifetime to be this many minutes from now.
2075
+ * This value must be a minimum of 5 and may not exceed the `maximum session duration minutes` value set in the {@link https://stytch.com/dashboard/sdk-configuration SDK Configuration} page of the Stytch dashboard.
2076
+ * A successful authentication will continue to extend the session this many minutes.
2077
+ */
2078
+ sessionDurationMinutes: number;
2079
+ /**
2080
+ * The text rendered on the cancel button when raising the biometric prompt. Defaults to "Cancel".
2081
+ */
2082
+ cancelButtonText?: string;
2083
+ /**
2084
+ * Allows user to enter their device credentials as a fallback for failed biometric authentication.
2085
+ */
2086
+ allowDeviceCredentials?: boolean;
2087
+ /**
2088
+ * The text rendered on the fallback prompt after biometrics has failed and allowDeviceCredentials is true. Defaults to "Enter Passcode". This only appears on iOS devices.
2089
+ */
2090
+ fallbackTitle?: string;
2091
+ };
2092
+ type BiometricsAuthenticateStartResponse = ResponseCommon & {
2093
+ /**
2094
+ * The challenge to be signed by the device.
2095
+ */
2096
+ challenge: string;
2097
+ /**
2098
+ * A unique ID that identifies a specific biometric registration.
2099
+ */
2100
+ biometric_registration_id: string;
2101
+ };
2102
+ type BiometricsAuthenticateCompleteResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = AuthenticateResponse<TProjectConfiguration> & {
2103
+ /**
2104
+ * A unique ID that identifies a specific biometric registration.
2105
+ */
2106
+ biometric_registration_id: string;
2107
+ /**
2108
+ * The device history of the user.
2109
+ */
2110
+ user_device?: SDKDeviceHistory;
2111
+ };
2112
+ type BiometricsDeleteResponse = ResponseCommon & {
2113
+ /**
2114
+ * A unique ID that identifies a specific biometric registration.
2115
+ */
2116
+ biometric_registration_id: string;
2117
+ /**
2118
+ * Globally unique UUID that identifies a specific user in the Stytch API.
2119
+ */
2120
+ user_id: string;
2121
+ };
2122
+ /**
2123
+ * Type of biometric authentication available on the device. iOS supports 'TouchID' or 'FaceID', and Android supports 'Biometrics'.
2124
+ */
2125
+ type BiometryType = 'TouchID' | 'FaceID' | 'Biometrics';
2126
+ type BiometricsGetSensorResponse = {
2127
+ /**
2128
+ * Type of biometric authentication available on the device.
2129
+ */
2130
+ biometryType: BiometryType;
2131
+ };
2132
+ interface IHeadlessBiometricsClient<TProjectConfiguration extends StytchProjectConfigurationInput> {
2133
+ /**
2134
+ * Indicates if there is an existing biometric registration on the device.
2135
+ *
2136
+ * @returns true if there is a biometric registration on the device, otherwise false.
2137
+ */
2138
+ isRegistrationAvailable: () => Promise<boolean>;
2139
+ /**
2140
+ * Indicates whether or not the Keystore is available on the device.
2141
+ *
2142
+ * @returns true if the keystore is available, otherwise false.
2143
+ */
2144
+ isKeystoreAvailable: () => Promise<boolean>;
2145
+ /**
2146
+ * Adds a biometric registration for the current user.
2147
+ *
2148
+ * @param options - {@link BiometricsRegisterOptions}
2149
+ *
2150
+ * @returns A {@link BiometricsRegisterCompleteResponse} indicating the biometric registration has been successful.
2151
+ *
2152
+ * @throws A `StytchSDKError` when the Stytch React Native module returns an error.
2153
+ */
2154
+ register: (options: BiometricsRegisterOptions) => Promise<BiometricsRegisterCompleteResponse<TProjectConfiguration>>;
2155
+ /**
2156
+ * Updates the session by using a biometric registration.
2157
+ *
2158
+ * @param options - {@link BiometricsAuthenticateOptions}
2159
+ *
2160
+ * @returns A {@link BiometricsRegisterCompleteResponse} indicating the authentication has been successful.
2161
+ *
2162
+ * @throws A `StytchSDKError` when the Stytch React Native module returns an error.
2163
+ */
2164
+ authenticate: (options: BiometricsAuthenticateOptions) => Promise<BiometricsAuthenticateCompleteResponse<TProjectConfiguration>>;
2165
+ /**
2166
+ * Attempts to remove the biometric registration from the user and device.
2167
+ *
2168
+ * @returns A {@link BiometricsDeleteResponse} indicating whether the deletion has been successful.
2169
+ */
2170
+ removeRegistration: () => Promise<BiometricsDeleteResponse>;
2171
+ /**
2172
+ * Checks the type of biometrics that is available on the device.
2173
+ *
2174
+ * @param allowDeviceCredentials Allows user to enter their device credentials as a fallback for failed biometric authentication.
2175
+ *
2176
+ * @returns A {@link BiometricsGetSensorResponse} containing a {@link BiometryType}.
2177
+ *
2178
+ * @throws A `StytchSDKError` when the Stytch React Native module returns an error.
2179
+ */
2180
+ getSensor: (allowDeviceCredentials?: boolean) => Promise<BiometricsGetSensorResponse>;
2181
+ /**
2182
+ * Gets the current biometric_registration_id saved on device, if it exists
2183
+ */
2184
+ getBiometricRegistrationId: () => Promise<string | undefined>;
2185
+ /**
2186
+ * Deletes the local biometric keys from the device, if any
2187
+ *
2188
+ * @returns true if keys were found and deleted from the device, false if no keys were present
2189
+ */
2190
+ deleteDeviceRegistration: () => Promise<boolean>;
2191
+ }
2192
+
2193
+ type ImpersonationAuthenticateOptions = {
2194
+ /**
2195
+ * The impersonation token used to authenticate a user
2196
+ */
2197
+ impersonation_token: string;
2198
+ };
2199
+ type ImpersonationAuthenticateResponse<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = AuthenticateResponse<TProjectConfiguration>;
2200
+ interface IHeadlessImpersonationClient<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> {
2201
+ /**
2202
+ * Wraps Stytch's {@link https://stytch.com/docs/api/authenticate-impersonation-token Authenticate Impersonation Token} endpoint.
2203
+ * The authenticate method wraps the consumer impersonation authenticate endpoint.
2204
+ *
2205
+ * @param data - {@link ImpersonationAuthenticateOptions}
2206
+ * @returns A {@link ImpersonationAuthenticateResponse} indicating that the token has been authenticated
2207
+ *
2208
+ * @throws A `StytchAPIError` when the Stytch API returns an error.
2209
+ * @throws A `StytchAPIUnreachableError` when the SDK cannot contact the Stytch API.
2210
+ * @throws A `StytchSDKUsageError` when called with invalid input (invalid token, invalid options, etc.)
2211
+ */
2212
+ authenticate(data: ImpersonationAuthenticateOptions): Promise<ImpersonationAuthenticateResponse<TProjectConfiguration>>;
2213
+ }
2214
+
2215
+ type Actions<Actions extends string> = Record<Actions, boolean>;
2216
+ type ConsumerPermissionsMap<Permissions extends Record<string, string>> = {
2217
+ [ResourceID in keyof Permissions]: Actions<Permissions[ResourceID]>;
2218
+ };
2219
+ interface IHeadlessRBACClient {
2220
+ /**
2221
+ * The `isAuthorizedSync` method determines whether the logged-in user is allowed to perform the specified action on the specified resource.
2222
+ * Returns `true` if the user can perform the action, `false` otherwise.
2223
+ *
2224
+ * If the user is not logged in, or the RBAC policy has not been loaded, this method will always return false.
2225
+ * If the resource or action provided are not valid for the configured RBAC policy, this method will return false.
2226
+ * @example
2227
+ * const isAuthorized = stytch.rbac.isAuthorizedSync<Permissions>('document', 'image');
2228
+ */
2229
+ isAuthorizedSync(resourceId: string, action: string): boolean;
2230
+ /**
2231
+ * The `isAuthorized` method determines whether the logged-in user is allowed to perform the specified action on the specified resource.
2232
+ * It will return a Promise that resolves after the RBAC policy has been loaded. Returns `true` if the user can perform the action, `false` otherwise.
2233
+ *
2234
+ * If the user is not logged in, this method will always return false.
2235
+ * If the resource or action provided are not valid for the configured RBAC policy, this method will return false.
2236
+ *
2237
+ * @example
2238
+ * const isAuthorized = await stytch.rbac.isAuthorizedSync<Permissions>('document', 'image');
2239
+ */
2240
+ isAuthorized(resourceId: string, action: string): Promise<boolean>;
2241
+ /**
2242
+ * The `allPermissions` method returns the complete list of permissions assigned to the currently logged-in user. If the user is not logged in, all values will be `false`.
2243
+ *
2244
+ * As a best practice, authorization checks for sensitive actions should also occur on the backend.
2245
+ *
2246
+ * @example
2247
+ * type Permissions = {
2248
+ * document: 'create' | 'read' | 'write
2249
+ * image: 'create' | 'read'
2250
+ * }
2251
+ * const permissions = await stytch.rbac.allPermissions<Permissions>();
2252
+ * console.log(permissions.document.create) // true
2253
+ * console.log(permissions.image.create) // false
2254
+ * @returns A {@link ConsumerPermissionsMap} for the active member
2255
+ */
2256
+ allPermissions<Permissions extends Record<string, string>>(): Promise<ConsumerPermissionsMap<Permissions>>;
2257
+ }
2258
+
2259
+ type OAuthAuthorizeStartOptions = {
2260
+ client_id: string;
2261
+ redirect_uri: string;
2262
+ response_type: string;
2263
+ scopes: string[];
2264
+ prompt?: string;
2265
+ };
2266
+ type OAuthAuthorizeStartResponse = ResponseCommon & {
2267
+ user_id: string;
2268
+ user: User;
2269
+ client: ConnectedAppPublic;
2270
+ consent_required: boolean;
2271
+ scope_results: ScopeResult[];
2272
+ };
2273
+ type OAuthAuthorizeSubmitOptions = {
2274
+ client_id: string;
2275
+ redirect_uri: string;
2276
+ response_type: string;
2277
+ scopes: string[];
2278
+ state?: string;
2279
+ nonce?: string;
2280
+ code_challenge?: string;
2281
+ consent_granted: boolean;
2282
+ prompt?: string;
2283
+ resource?: string[];
2284
+ };
2285
+ type OAuthAuthorizeSubmitResponse = ResponseCommon & {
2286
+ redirect_uri: string;
2287
+ authorization_code?: string;
2288
+ };
2289
+ type OAuthLogoutStartOptions = {
2290
+ client_id: string;
2291
+ post_logout_redirect_uri: string;
2292
+ state?: string;
2293
+ id_token_hint?: string;
2294
+ };
2295
+ type OAuthLogoutStartResponse = ResponseCommon & {
2296
+ redirect_uri: string;
2297
+ consent_required: boolean;
2298
+ };
2299
+ interface IHeadlessIDPClient {
2300
+ /**
2301
+ * Initiates a request for authorization of a Connected App to access a User's account.
2302
+ *
2303
+ * Call this endpoint using the query parameters from an OAuth Authorization request. This endpoint validates various fields (scope, client_id, redirect_uri, prompt, etc...) are correct and returns relevant information for rendering an OAuth Consent Screen.
2304
+ *
2305
+ * @param data - The options for the OAuth authorization flow.
2306
+ * @returns The response from the OAuth authorization flow.
2307
+ * @example
2308
+ * const response = await stytch.idp.oauthAuthorizeStart({
2309
+ * client_id: 'client_123',
2310
+ */
2311
+ oauthAuthorizeStart(data: OAuthAuthorizeStartOptions): Promise<OAuthAuthorizeStartResponse>;
2312
+ /**
2313
+ * Completes a request for authorization of a Connected App to access a Member's account.
2314
+ *
2315
+ * Call this endpoint using the query parameters from an OAuth Authorization request, after previously validating those parameters using the Preflight Check API. Note that this endpoint takes in a few additional parameters the preflight check does not- state, nonce, and code_challenge.
2316
+ *
2317
+ * If the authorization was successful, the redirect_uri will contain a valid authorization_code embedded as a query parameter. If the authorization was unsuccessful, the redirect_uri will contain an OAuth2.1 error_code. In both cases, redirect the Member to the location for the response to be consumed by the Connected App.
2318
+ *
2319
+ * Exactly one of the following must be provided to identify the Member granting authorization:
2320
+ * organization_id + member_id
2321
+ * session_token
2322
+ * session_jwt
2323
+ *
2324
+ * If a session_token or session_jwt is passed, the OAuth Authorization will be linked to the Member's session for tracking purposes. One of these fields must be used if the Connected App intends to complete the Exchange Access Token flow.
2325
+ *
2326
+ * @param data - The options for the OAuth authorization flow.
2327
+ * @returns The response from the OAuth authorization flow.
2328
+ * @example
2329
+ * const response = await stytch.idp.oauthAuthorizeSubmit({
2330
+ * client_id: 'client_123',
2331
+ * redirect_uri: 'https://example.com/callback',
2332
+ * scope: 'openid email profile',
2333
+ * });
2334
+ */
2335
+ oauthAuthorizeSubmit(data: OAuthAuthorizeSubmitOptions): Promise<OAuthAuthorizeSubmitResponse>;
2336
+ }
2337
+
2338
+ type TokenType = 'magic_links' | 'oauth' | 'reset_password';
2339
+
2340
+ type DeepReadonly<T> = {
2341
+ readonly [P in keyof T]: DeepReadonly<T[P]>;
2342
+ };
2343
+ type StateChangeHandler<T> = (state: DeepReadonly<T>) => void;
2344
+ type StateChangeRegisterFunction<T> = (callback: StateChangeHandler<T>) => UnsubscribeFunction;
2345
+
2346
+ interface PromptMomentNotification {
2347
+ isDisplayMoment: () => boolean;
2348
+ isDisplayed: () => boolean;
2349
+ isNotDisplayed: () => boolean;
2350
+ getNotDisplayedReason: () =>
2351
+ | "browser_not_supported"
2352
+ | "invalid_client"
2353
+ | "missing_client_id"
2354
+ | "opt_out_or_no_session"
2355
+ | "secure_http_required"
2356
+ | "suppressed_by_user"
2357
+ | "unregistered_origin"
2358
+ | "unknown_reason";
2359
+ isSkippedMoment: () => boolean;
2360
+ getSkippedReason: () => "auto_cancel" | "user_cancel" | "tap_outside" | "issuing_failed";
2361
+ isDismissedMoment: () => boolean;
2362
+ getDismissedReason: () => "credential_returned" | "cancel_called" | "flow_restarted";
2363
+ getMomentType: () => "display" | "skipped" | "dismissed";
2364
+ }
2365
+
2366
+ type OneTapNotShownReason = ReturnType<PromptMomentNotification['getNotDisplayedReason']> | ReturnType<PromptMomentNotification['getSkippedReason']>;
2367
+ type OneTapRenderResult = {
2368
+ success: true;
2369
+ } | {
2370
+ success: false;
2371
+ reason: OneTapNotShownReason;
2372
+ };
2373
+
2374
+ type ParseAuthenticateUrl<HandledTokenType extends string> = (href?: string) => {
2375
+ handled: true;
2376
+ token: string;
2377
+ tokenType: HandledTokenType;
2378
+ } | {
2379
+ handled: false;
2380
+ token: string;
2381
+ tokenType: string;
2382
+ } | null;
2383
+ type AuthenticateByUrl<TokenType extends string> = (options: {
2384
+ /**
2385
+ * Clear token and stytch_token_type URL params after authenticate is called.
2386
+ * @default true if the href parameter is window.location.href (the default)
2387
+ **/
2388
+ clearParams?: boolean;
2389
+ } & SessionDurationOptions,
2390
+ /**
2391
+ * Allow overriding URL where the token and stytch_token_type params are extracted from.
2392
+ * You usually would not need to set this.
2393
+ * @default window.location.href
2394
+ */
2395
+ href?: string) => Promise<{
2396
+ handled: true;
2397
+ tokenType: TokenType;
2398
+ data: unknown;
2399
+ } | {
2400
+ handled: false;
2401
+ tokenType: string;
2402
+ token: string;
2403
+ } | null>;
2404
+
2405
+ export { B2BMFAProducts as aH, AuthFlowType as aw, RedirectURLType as ax, B2BOAuthProviders as ay };
2406
+ export type { BiometricsAuthenticateOptions as $, AuthenticateByUrl as A, B2BOAuthAuthorizeStartOptions as B, OAuthAuthenticateResponse as C, OAuthStartFailureReason as D, OAuthStartResponse as E, IOAuthProvider as F, OAuthAttachResponse as G, UserUpdateOptions as H, IHeadlessIDPClient as I, UserUpdateResponse as J, UserInfo as K, UserGetConnectedAppsResponse as L, TOTPCreateOptions as M, TOTPCreateResponse as N, OAuthAuthorizeStartOptions as O, ParseAuthenticateUrl as P, TOTPAuthenticateOptions as Q, TOTPAuthenticateResponse as R, StateChangeRegisterFunction as S, TokenType as T, UserOnChangeCallback as U, TOTPRecoveryCodesResponse as V, TOTPRecoverOptions as W, TOTPRecoverResponse as X, BiometricsRegisterOptions as Y, BiometricsRegisterStartResponse as Z, BiometricsRegisterCompleteResponse as _, INetworkClient as a, CommonB2BLoginConfig as a$, BiometricsAuthenticateStartResponse as a0, BiometricsAuthenticateCompleteResponse as a1, BiometricsDeleteResponse as a2, BiometryType as a3, BiometricsGetSensorResponse as a4, IHeadlessBiometricsClient as a5, B2BSessionAuthenticateResponse as a6, B2BSessionRevokeOptions as a7, B2BSessionRevokeForMemberOptions as a8, B2BSessionRevokeForMemberResponse as a9, B2BSSOOptions as aA, B2BOAuthOptions as aB, B2BOAuthProviderConfig as aC, B2BPasswordOptions as aD, B2BEmailOTPOptions as aE, B2BSMSOTPOptions as aF, DirectLoginForSingleMembershipConfig as aG, SCIMConnection as aI, SCIMConnectionWithBearerToken as aJ, SCIMConnectionWithNextBearerToken as aK, SCIMGroup as aL, B2BSCIMCreateConnectionOptions as aM, B2BSCIMCreateConnectionResponse as aN, B2BSCIMUpdateConnectionOptions as aO, B2BSCIMUpdateConnectionResponse as aP, B2BSCIMDeleteConnectionResponse as aQ, B2BSCIMGetConnectionResponse as aR, B2BSCIMGetConnectionGroupsOptions as aS, B2BSCIMGetConnectionGroupsResponse as aT, B2BSCIMRotateStartResponse as aU, B2BSCIMRotateCompleteResponse as aV, B2BSCIMRotateCancelResponse as aW, ImpersonationAuthenticateOptions as aX, ImpersonationAuthenticateResponse as aY, ConsumerPermissionsMap as aZ, CommonLoginConfig as a_, B2BSessionOnChangeCallback as aa, B2BSessionExchangeOptions as ab, B2BSessionExchangeResponse as ac, B2BSessionAccessTokenExchangeOptions as ad, B2BSessionAccessTokenExchangeResponse as ae, MemberSessionInfo as af, B2BSessionAttestOptions as ag, B2BSessionAttestResponse as ah, B2BMemberOnChangeCallback as ai, B2BMemberUpdateOptions as aj, B2BMemberUnlinkRetiredEmailRequest as ak, B2BMemberStartEmailUpdateRequest as al, B2BMemberStartEmailUpdateResponse as am, B2BMemberGetConnectedAppsResponse as an, B2BMemberRevokeConnectedAppOptions as ao, B2BMemberRevokeConnectedAppResponse as ap, B2BMemberUpdateResponse as aq, B2BMemberDeleteMFAPhoneNumberResponse as ar, B2BMemberDeletePasswordResponse as as, B2BMemberDeleteMFATOTPResponse as at, B2BMemberUnlinkRetiredEmailResponse as au, MemberInfo as av, B2BEmailMagicLinksOptions as az, OAuthAuthorizeStartResponse as b, OAuthAuthorizeSubmitOptions as c, OAuthAuthorizeSubmitResponse as d, OAuthLogoutStartOptions as e, OAuthLogoutStartResponse as f, IHeadlessOAuthClient as g, OneTapRenderResult as h, IHeadlessUserClient as i, IHeadlessTOTPClient as j, IHeadlessImpersonationClient as k, IHeadlessRBACClient as l, IHeadlessB2BIDPClient as m, B2BOAuthAuthorizeStartResponse as n, B2BOAuthAuthorizeSubmitOptions as o, B2BOAuthAuthorizeSubmitResponse as p, B2BOAuthLogoutStartOptions as q, B2BOAuthLogoutStartResponse as r, IHeadlessB2BSessionClient as s, IHeadlessB2BMemberClient as t, IHeadlessB2BSelfClient as u, IHeadlessB2BRBACClient as v, IHeadlessB2BSCIMClient as w, PermissionsMap as x, OAuthGetURLOptions as y, OAuthAuthenticateOptions as z };