@playbasis-ai/qwikcard-sdk 2.3.9 → 2.3.11

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
@@ -49,6 +49,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
49
49
 
50
50
  - Hid the profile header section in the embedded widget for QwikCard.
51
51
 
52
+ ## [2.3.10] - 2026-01-21
53
+
54
+ ### Changed
55
+
56
+ - Updated README event list with XP values from the QwikCard rulebook.
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
+
52
64
  ## [2.3.3] - 2026-01-19
53
65
 
54
66
  ### Fixed
package/README.md CHANGED
@@ -215,14 +215,23 @@ function TransactionLogger() {
215
215
  ## Event Types
216
216
 
217
217
  ```typescript
218
+ // XP values follow the QwikCard XP rulebook in QWIK_PLAYBASIS_GAMIFICATION_DESIGN.md.
218
219
  type QwikCardEventType =
219
- | 'card.purchase' // Debit card transaction
220
- | 'card.deposit' // Direct deposit
221
- | 'card.atm' // ATM withdrawal
222
- | 'qwikit.sent' // P2P transfer sent
223
- | 'qwikit.received' // P2P transfer received
224
- | 'referral.signup' // Friend signed up
225
- | 'profile.complete'; // Profile completed
220
+ | 'auth.signup' // Account created (+50 XP, once)
221
+ | 'auth.login' // Daily login (+5 XP, 1/day)
222
+ | 'profile.updated' // Profile progress (+25 XP, max 3 lifetime)
223
+ | 'card.activated' // Card activation (+150 XP, once)
224
+ | 'card.deposit' // Funding action (+40 XP, 1/day)
225
+ | 'budget.created' // Budget created (+120 XP, 1/quarter)
226
+ | 'transactions.viewed' // Transaction review (+10 XP, 1/day)
227
+ | 'credit.score_viewed' // Credit score check (+40 XP, 1/week)
228
+ | 'qwikit.sent' // P2P transfer sent (+20 XP, max 5/day)
229
+ | 'qwikit.received' // P2P transfer received (+10 XP, max 5/day)
230
+ | 'qwikit.requested' // P2P transfer requested (+10 XP, max 5/day)
231
+ | 'referral.completed' // Referral success (+250 XP, max 10 lifetime)
232
+ | 'learning.lesson_started' // Lesson started (+10 XP, max 3/day)
233
+ | 'learning.lesson_completed' // Lesson completed (+75 XP, max 3/day)
234
+ | 'offers.map_viewed'; // Offers map viewed (+5 XP, 1/day)
226
235
  ```
227
236
 
228
237
  ## API Reference
@@ -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
  // ─────────────────────────────────────────────────────────────────────────────
@@ -1 +1 @@
1
- {"version":3,"file":"widgetAssets.d.ts","sourceRoot":"","sources":["../../src/web/widgetAssets.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAC1C,eAAO,MAAM,aAAa,ilu8BAC89s8B,CAAC;AACz/s8B,eAAO,MAAM,UAAU,00rEACkzrE,CAAC"}
1
+ {"version":3,"file":"widgetAssets.d.ts","sourceRoot":"","sources":["../../src/web/widgetAssets.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAC1C,eAAO,MAAM,aAAa,ilu8BACwzn7B,CAAC;AACn1n7B,eAAO,MAAM,UAAU,00rEAC0trE,CAAC"}