@nebulr-group/bridge-svelte 0.3.0-beta.2 → 0.3.0-beta.6

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.
@@ -12,6 +12,12 @@ export async function bridgeBootstrap(url, config, routeConfig = { rules: [], de
12
12
  return;
13
13
  }
14
14
  const finalConfig = typeof config === 'string' ? { appId: config } : config;
15
+ // Persist Stripe Checkout session_id to sessionStorage before any framework
16
+ // redirects (e.g. SvelteKit goto) can strip it from the URL. auth-core's
17
+ // getSubscriptionStatus() will pick it up and trigger a server-side sync.
18
+ if (typeof sessionStorage !== 'undefined' && url.searchParams.has('session_id')) {
19
+ sessionStorage.setItem('bridge_checkout_session_id', url.searchParams.get('session_id'));
20
+ }
15
21
  // 1. Initialize configuration (synchronously) — this also calls initBridge()
16
22
  bridgeConfig.initConfig(finalConfig, routeConfig);
17
23
  // 1a. If we're on bridge OAuth callback route, let bridge dedicated route handle it
@@ -41,7 +41,7 @@
41
41
  loading = true;
42
42
  error = null;
43
43
  try {
44
- tokens = await getBridgeAuth().apiTokens.listAppTokens();
44
+ tokens = await getBridgeAuth().apiTokens.listTokens();
45
45
  } catch (err) {
46
46
  error = err instanceof Error ? err.message : 'Failed to load API tokens';
47
47
  } finally {
@@ -72,7 +72,7 @@
72
72
  privileges: selectedPrivileges,
73
73
  expireAt: createExpiry || undefined,
74
74
  };
75
- const result = await getBridgeAuth().apiTokens.createAppToken(input);
75
+ const result = await getBridgeAuth().apiTokens.createToken(input);
76
76
  newToken = result.token;
77
77
  tokens = [result.record, ...tokens];
78
78
  showCreateForm = false;
@@ -100,7 +100,7 @@
100
100
  revoking = true;
101
101
  error = null;
102
102
  try {
103
- await getBridgeAuth().apiTokens.revokeAppToken(revokeTarget.id);
103
+ await getBridgeAuth().apiTokens.revokeToken(revokeTarget.id);
104
104
  tokens = tokens.filter((t) => t.id !== revokeTarget!.id);
105
105
  success = `Token "${revokeTarget.name}" revoked.`;
106
106
  revokeDialogOpen = false;
@@ -180,7 +180,7 @@
180
180
  {:else if price.amount === 0}
181
181
  Select free plan
182
182
  {:else}
183
- {price.amount / 100} {price.currency.toUpperCase()} / {price.recurrenceInterval}
183
+ {price.amount} {price.currency.toUpperCase()} / {price.recurrenceInterval}
184
184
  {/if}
185
185
  </button>
186
186
  {/each}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebulr-group/bridge-svelte",
3
- "version": "0.3.0-beta.2",
3
+ "version": "0.3.0-beta.6",
4
4
  "description": "Bridge Svelte library, This library helps you to add bridge authentication and feature flags, and payments to your svelte application.",
5
5
  "author": "Iman Pouya",
6
6
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  }
61
61
  },
62
62
  "dependencies": {
63
- "@nebulr-group/bridge-auth-core": "0.1.0-beta.2"
63
+ "@nebulr-group/bridge-auth-core": "0.1.0-beta.4"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@sveltejs/kit": "^2.16.0",