@playbasis-ai/qwikcard-sdk 2.3.10 → 2.3.12

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/CHANGELOG.md CHANGED
@@ -55,6 +55,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55
55
 
56
56
  - Updated README event list with XP values from the QwikCard rulebook.
57
57
 
58
+ ## [2.3.11] - 2026-01-29
59
+
60
+ ### Changed
61
+
62
+ - Updated widget SDK data flow to require live API responses (no dummy fallback).
63
+
64
+ ## [2.3.12] - 2026-01-29
65
+
66
+ ### Changed
67
+
68
+ - Rebuilt embedded widget bundle with latest API-driven badge/quest logic.
69
+
58
70
  ## [2.3.3] - 2026-01-19
59
71
 
60
72
  ### Fixed
@@ -1 +1 @@
1
- {"version":3,"file":"PlaybasisProvider.d.ts","sourceRoot":"","sources":["../src/PlaybasisProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,UAAU,qBAAqB;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,MAAM,EACN,QAAqB,EACrB,QAAQ,EACR,OAAuD,GACxD,EAAE,sBAAsB,2CAgBxB;AAMD,wBAAgB,YAAY,IAAI,qBAAqB,CAMpD;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"PlaybasisProvider.d.ts","sourceRoot":"","sources":["../src/PlaybasisProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,UAAU,qBAAqB;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAiBD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,EAAE,sBAAsB,2CAwBxB;AAMD,wBAAgB,YAAY,IAAI,qBAAqB,CAMpD;AAED,eAAe,iBAAiB,CAAC"}
@@ -3,12 +3,30 @@ import { createContext, useContext, useMemo } from 'react';
3
3
  import { PlaybasisClient } from './api/client';
4
4
  import { ThemeProvider } from './theme/context';
5
5
  const PlaybasisContext = createContext(null);
6
+ const QWIK_BASE_URLS = {
7
+ production: 'https://apim-pb-production.azure-api.net/v1',
8
+ staging: 'https://apim-pb-staging.azure-api.net/playbasis/v1',
9
+ };
10
+ const resolveBaseUrl = (tenantId, baseUrl) => {
11
+ if (baseUrl)
12
+ return baseUrl;
13
+ if (tenantId.toLowerCase().includes('prod'))
14
+ return QWIK_BASE_URLS.production;
15
+ return QWIK_BASE_URLS.staging;
16
+ };
6
17
  // ─────────────────────────────────────────────────────────────────────────────
7
18
  // Provider Component
8
19
  // ─────────────────────────────────────────────────────────────────────────────
9
- export function PlaybasisProvider({ children, apiKey, tenantId = 'qwikcard', playerId, baseUrl = 'https://apim-pb-production.azure-api.net/v1', }) {
10
- const client = useMemo(() => new PlaybasisClient({ apiKey, tenantId, baseUrl }), [apiKey, tenantId, baseUrl]);
11
- const value = useMemo(() => ({ client, tenantId, playerId: playerId ?? null, baseUrl }), [client, tenantId, playerId, baseUrl]);
20
+ export function PlaybasisProvider({ children, apiKey, tenantId, playerId, baseUrl, }) {
21
+ const resolvedTenantId = tenantId ?? (baseUrl && baseUrl.includes('production') ? 'qwik-prod' : 'qwikcard');
22
+ const resolvedBaseUrl = resolveBaseUrl(resolvedTenantId, baseUrl);
23
+ const client = useMemo(() => new PlaybasisClient({ apiKey, tenantId: resolvedTenantId, baseUrl: resolvedBaseUrl }), [apiKey, resolvedTenantId, resolvedBaseUrl]);
24
+ const value = useMemo(() => ({
25
+ client,
26
+ tenantId: resolvedTenantId,
27
+ playerId: playerId ?? null,
28
+ baseUrl: resolvedBaseUrl,
29
+ }), [client, resolvedTenantId, playerId, resolvedBaseUrl]);
12
30
  return (_jsx(ThemeProvider, { children: _jsx(PlaybasisContext.Provider, { value: value, children: children }) }));
13
31
  }
14
32
  // ─────────────────────────────────────────────────────────────────────────────