@elvix.is/sdk 0.5.9 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.d.ts CHANGED
@@ -276,6 +276,7 @@ declare function ElvixSignIn({ onResult, redirectAfterSignIn, copy: copyProp, cl
276
276
  type ElvixSignInResult = {
277
277
  ok: true;
278
278
  redirect?: string;
279
+ token?: string;
279
280
  } | {
280
281
  ok: false;
281
282
  error: string;
package/dist/react.js CHANGED
@@ -1563,14 +1563,15 @@ function AuthBody({
1563
1563
  return;
1564
1564
  }
1565
1565
  const redirect = finalRedirect(body.redirect ?? defaultRedirect(intent));
1566
- onResult?.({ ok: true, redirect });
1566
+ const token = body.token ?? getElvixToken() ?? void 0;
1567
+ onResult?.({ ok: true, redirect, token });
1567
1568
  if (onAuthenticated) {
1568
- onAuthenticated({ ok: true, redirect, token: body.token });
1569
+ onAuthenticated({ ok: true, redirect, token });
1569
1570
  return;
1570
1571
  }
1571
1572
  window.location.href = redirect;
1572
1573
  },
1573
- [intent, onAuthenticated, onResult, finalRedirect]
1574
+ [intent, onAuthenticated, onResult, finalRedirect, baseUrl]
1574
1575
  );
1575
1576
  useEffect4(() => {
1576
1577
  if (isPreview) return;
@@ -1804,9 +1805,10 @@ function AuthBody({
1804
1805
  return;
1805
1806
  }
1806
1807
  const redirect = finalRedirect();
1807
- onResult?.({ ok: true, redirect });
1808
+ const token = getElvixToken() ?? void 0;
1809
+ onResult?.({ ok: true, redirect, token });
1808
1810
  if (onAuthenticated) {
1809
- onAuthenticated({ ok: true, redirect });
1811
+ onAuthenticated({ ok: true, redirect, token });
1810
1812
  return;
1811
1813
  }
1812
1814
  window.location.href = redirect;
@@ -1818,9 +1820,10 @@ function AuthBody({
1818
1820
  if (onboardingBusy) return;
1819
1821
  setOnboardingBusy("skip");
1820
1822
  const redirect = finalRedirect();
1821
- onResult?.({ ok: true, redirect });
1823
+ const token = getElvixToken() ?? void 0;
1824
+ onResult?.({ ok: true, redirect, token });
1822
1825
  if (onAuthenticated) {
1823
- onAuthenticated({ ok: true, redirect });
1826
+ onAuthenticated({ ok: true, redirect, token });
1824
1827
  return;
1825
1828
  }
1826
1829
  window.location.href = redirect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvix.is/sdk",
3
- "version": "0.5.9",
3
+ "version": "0.6.1",
4
4
  "description": "Official elvix SDK. Drop-in React components, server helpers, and an MCP server so AI coding agents integrate elvix on the first try.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://elvix.is",