@sylphx/sdk 0.7.0 → 0.8.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -924,7 +924,7 @@ type FlagClientEvent = {
924
924
  * import { createClient } from '@sylphx/sdk'
925
925
  *
926
926
  * const sylphx = createClient(process.env.SYLPHX_URL!)
927
- * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.sylphx.com
927
+ * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
928
928
  * ```
929
929
  */
930
930
 
@@ -943,7 +943,7 @@ interface SylphxConfig {
943
943
  readonly env: 'dev' | 'stg' | 'prod' | 'prev';
944
944
  /** Resource slug (first DNS label), e.g. 'bold-river-a1b2c3' */
945
945
  readonly slug: string;
946
- /** Pre-computed API base URL, e.g. 'https://bold-river-a1b2c3.sylphx.com/v1' */
946
+ /** Pre-computed API base URL, e.g. 'https://bold-river-a1b2c3.api.sylphx.com/v1' */
947
947
  readonly baseUrl: string;
948
948
  /** Optional access token for authenticated requests */
949
949
  readonly accessToken?: string;
@@ -42734,7 +42734,7 @@ function parseConnectionUrl(url) {
42734
42734
  init_constants();
42735
42735
  var LEGACY_EMBEDDED_REF_PATTERN = /^(pk|sk)_(dev|stg|prod|prev)_[a-z0-9]{12}_[a-f0-9]+$/;
42736
42736
  var LEGACY_APP_KEY_PATTERN = /^app_(dev|stg|prod|prev)_/;
42737
- var MIGRATION_MESSAGE = "API key format has changed. Use a sylphx:// connection URL instead.\n\nNew format: sylphx://pk_prod_{hex}@your-slug.sylphx.com\n\nGenerate new credentials from the Sylphx Console \u2192 Your App \u2192 Environments.\nSee https://docs.sylphx.com/migration for details.";
42737
+ var MIGRATION_MESSAGE = "API key format has changed. Use a sylphx:// connection URL instead.\n\nNew format: sylphx://pk_prod_{hex}@your-slug.api.sylphx.com\n\nGenerate new credentials from the Sylphx Console \u2192 Your App \u2192 Environments.\nSee https://docs.sylphx.com/migration for details.";
42738
42738
  function rejectLegacyKeyFormat(input) {
42739
42739
  const trimmed = input.trim().toLowerCase();
42740
42740
  if (LEGACY_APP_KEY_PATTERN.test(trimmed)) {
@@ -42767,7 +42767,7 @@ function createClient(input) {
42767
42767
  function createConfigFromUrl(url) {
42768
42768
  if (!url || typeof url !== "string") {
42769
42769
  throw new SylphxError(
42770
- "[Sylphx] Connection URL is required. Set SYLPHX_URL or NEXT_PUBLIC_SYLPHX_URL environment variable.\n\nFormat: sylphx://pk_prod_{hex}@your-slug.sylphx.com",
42770
+ "[Sylphx] Connection URL is required. Set SYLPHX_URL or NEXT_PUBLIC_SYLPHX_URL environment variable.\n\nFormat: sylphx://pk_prod_{hex}@your-slug.api.sylphx.com",
42771
42771
  { code: "BAD_REQUEST" }
42772
42772
  );
42773
42773
  }
@@ -42776,7 +42776,7 @@ function createConfigFromUrl(url) {
42776
42776
  if (!trimmed.startsWith("sylphx://")) {
42777
42777
  if (CREDENTIAL_REGEX.test(trimmed)) {
42778
42778
  throw new SylphxError(
42779
- "[Sylphx] Received a bare credential instead of a connection URL.\n\nWrap it in a connection URL: sylphx://<credential>@<slug>.sylphx.com\nOr use createClient({ slug, publicKey }) for explicit components.",
42779
+ "[Sylphx] Received a bare credential instead of a connection URL.\n\nWrap it in a connection URL: sylphx://<credential>@<slug>.api.sylphx.com\nOr use createClient({ slug, publicKey }) for explicit components.",
42780
42780
  { code: "BAD_REQUEST" }
42781
42781
  );
42782
42782
  }
@@ -54788,7 +54788,7 @@ function SylphxProviderInner({
54788
54788
  }, [authState.isSignedIn, authPrefix]);
54789
54789
  const resetPassword = useCallback66(
54790
54790
  async (options) => {
54791
- const response = await fetch(`${platformUrl}/api/auth/reset-password`, {
54791
+ const response = await fetch(`${platformUrl}/v1/auth/reset-password`, {
54792
54792
  method: "POST",
54793
54793
  headers: { "Content-Type": "application/json" },
54794
54794
  body: JSON.stringify({
@@ -54806,7 +54806,7 @@ function SylphxProviderInner({
54806
54806
  );
54807
54807
  const verifyEmail = useCallback66(
54808
54808
  async (options) => {
54809
- const response = await fetch(`${platformUrl}/api/auth/verify-email`, {
54809
+ const response = await fetch(`${platformUrl}/v1/auth/verify-email`, {
54810
54810
  method: "POST",
54811
54811
  headers: { "Content-Type": "application/json" },
54812
54812
  body: JSON.stringify({
@@ -54823,7 +54823,7 @@ function SylphxProviderInner({
54823
54823
  );
54824
54824
  const resendVerificationEmail = useCallback66(
54825
54825
  async (options) => {
54826
- const response = await fetch(`${platformUrl}/api/auth/resend-verification`, {
54826
+ const response = await fetch(`${platformUrl}/v1/auth/resend-verification`, {
54827
54827
  method: "POST",
54828
54828
  headers: { "Content-Type": "application/json" },
54829
54829
  body: JSON.stringify({
@@ -54840,7 +54840,7 @@ function SylphxProviderInner({
54840
54840
  );
54841
54841
  const forgotPassword = useCallback66(
54842
54842
  async (options) => {
54843
- const response = await fetch(`${platformUrl}/api/auth/forgot-password`, {
54843
+ const response = await fetch(`${platformUrl}/v1/auth/forgot-password`, {
54844
54844
  method: "POST",
54845
54845
  headers: { "Content-Type": "application/json" },
54846
54846
  body: JSON.stringify({
@@ -55728,7 +55728,7 @@ function SylphxProviderInner({
55728
55728
  });
55729
55729
  },
55730
55730
  verifyEmail: async (token) => {
55731
- const response = await fetch(`${platformUrl}/api/auth/verify-email`, {
55731
+ const response = await fetch(`${platformUrl}/v1/auth/verify-email`, {
55732
55732
  method: "POST",
55733
55733
  headers: { "Content-Type": "application/json" },
55734
55734
  body: JSON.stringify({ token, client_id: appId || "" })
@@ -55758,8 +55758,8 @@ function SylphxProviderInner({
55758
55758
  },
55759
55759
  getOAuthProviders: async () => {
55760
55760
  if (!appId) return { providers: [] };
55761
- const response = await fetch(`${platformUrl}/api/auth/providers`, {
55762
- headers: { "X-App-Id": appId }
55761
+ const response = await fetch(`${platformUrl}/v1/auth/oauth-providers`, {
55762
+ headers: { "x-app-secret": appId }
55763
55763
  });
55764
55764
  if (!response.ok) {
55765
55765
  return { providers: [] };