@playbasis-ai/qwikcard-sdk 2.3.5 → 2.3.7
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 +0 -6
- package/README.md +8 -8
- package/SDK_HANDOVER_GUIDE.md +3 -3
- package/dist/QwikCardApp.js +2 -2
- package/dist/hooks/usePoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/QwikCardApp.tsx +15 -15
- package/src/hooks/usePoints.ts +1 -1
- package/src/types/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -37,12 +37,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
37
37
|
- Updated production handover guidance to use production APIM base path `/v1`.
|
|
38
38
|
- Prepared new-tenant handover workflow for `qwik-prod` without requiring Expo.
|
|
39
39
|
|
|
40
|
-
## [2.3.3] - 2026-01-19
|
|
41
|
-
|
|
42
|
-
### Fixed
|
|
43
|
-
|
|
44
|
-
- Updated `Currency` type and `usePoints` hook to use `coins` (matching API) instead of `qwik-coins`.
|
|
45
|
-
|
|
46
40
|
## [2.3.2] - 2026-01-17
|
|
47
41
|
|
|
48
42
|
### Changed
|
package/README.md
CHANGED
|
@@ -22,10 +22,10 @@ npm install @playbasis-ai/qwikcard-sdk
|
|
|
22
22
|
|
|
23
23
|
### Peer Dependencies
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
You must install the following dependencies in your project:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm install react-native-linear-gradient
|
|
28
|
+
npm install react-native-linear-gradient react-native-svg react-native-webview
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
### Local Installation (if not published to npm)
|
|
@@ -45,12 +45,12 @@ npm install /absolute/path/to/playbasis-sdk
|
|
|
45
45
|
|
|
46
46
|
#### 2. From a Tarball (.tgz or .zip)
|
|
47
47
|
|
|
48
|
-
If you have a file like `playbasis-
|
|
48
|
+
If you have a file like `playbasis-qwikcard-sdk-1.0.0.zip` or `.tgz`, you can install directly:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
yarn add ./client-sdks/qwikcard-sdk
|
|
51
|
+
yarn add ./client-sdks/qwikcard-sdk/playbasis-qwikcard-sdk-1.0.0.zip
|
|
52
52
|
# or
|
|
53
|
-
npm install ./client-sdks/qwikcard-sdk
|
|
53
|
+
npm install ./client-sdks/qwikcard-sdk/playbasis-qwikcard-sdk-1.0.0.zip
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
#### 3. npm/yarn link (for active development)
|
|
@@ -76,9 +76,9 @@ yarn link @playbasis-ai/qwikcard-sdk
|
|
|
76
76
|
If the SDK is hosted in a private Git repo:
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
yarn add git+https://github.com/
|
|
79
|
+
yarn add git+https://github.com/playbasis/playbasis-platform.git
|
|
80
80
|
# or
|
|
81
|
-
npm install git+https://github.com/
|
|
81
|
+
npm install git+https://github.com/playbasis/playbasis-platform.git
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
---
|
|
@@ -111,7 +111,7 @@ export default function RewardsAndGamificationScreen() {
|
|
|
111
111
|
apiKey="YOUR_SUBSCRIPTION_KEY"
|
|
112
112
|
tenantId="YOUR_TENANT_ID"
|
|
113
113
|
playerId={currentUser.playbasisPlayerId}
|
|
114
|
-
baseUrl="https://api.playbasis
|
|
114
|
+
baseUrl="https://apim-pb-staging.azure-api.net/playbasis/v1" // optional
|
|
115
115
|
leaderboardId="YOUR_LEADERBOARD_ID" // optional
|
|
116
116
|
/>
|
|
117
117
|
);
|
package/SDK_HANDOVER_GUIDE.md
CHANGED
|
@@ -51,7 +51,7 @@ For the most professional "NPM experience" without public exposure, use **GitHub
|
|
|
51
51
|
1. **Publish to GitHub**: Configure your `package.json` to point to the `@rzforemost` scope on GitHub.
|
|
52
52
|
2. **Install via NPM**:
|
|
53
53
|
```bash
|
|
54
|
-
npm install @
|
|
54
|
+
npm install @playbasis-ai/qwikcard-sdk
|
|
55
55
|
```
|
|
56
56
|
_(Note: Requires a `.npmrc` file with a GitHub Personal Access Token)._
|
|
57
57
|
|
|
@@ -60,14 +60,14 @@ For the most professional "NPM experience" without public exposure, use **GitHub
|
|
|
60
60
|
If your team prefers an "invocation" style, simply wrap the `QwikCardApp` in a single screen or a conditional overlay. This effectively "invokes" the entire template library in one line:
|
|
61
61
|
|
|
62
62
|
```tsx
|
|
63
|
-
import { QwikCardApp } from '@
|
|
63
|
+
import { QwikCardApp } from '@playbasis-ai/qwikcard-sdk';
|
|
64
64
|
|
|
65
65
|
const MyScreen = () => (
|
|
66
66
|
<QwikCardApp
|
|
67
67
|
apiKey="YOUR_API_KEY"
|
|
68
68
|
tenantId="YOUR_TENANT_ID"
|
|
69
69
|
playerId="USER_123"
|
|
70
|
-
baseUrl="https://api.playbasis
|
|
70
|
+
baseUrl="https://apim-pb-staging.azure-api.net/playbasis/v1" // optional
|
|
71
71
|
leaderboardId="YOUR_LEADERBOARD_ID" // optional
|
|
72
72
|
/>
|
|
73
73
|
);
|
package/dist/QwikCardApp.js
CHANGED
|
@@ -33,8 +33,8 @@ function AppContent({ leaderboardId }) {
|
|
|
33
33
|
const [player, balances, quests, allBadges, playerBadges, rewards] = await Promise.all([
|
|
34
34
|
client.getPlayer(playerId),
|
|
35
35
|
client.getBalances(playerId),
|
|
36
|
-
client.getPlayerQuests(playerId),
|
|
37
|
-
client.getBadges(),
|
|
36
|
+
client.getPlayerQuests(playerId).catch(() => []), // Gracefully handle if endpoint missing
|
|
37
|
+
client.getBadges().catch(() => []), // Gracefully handle if endpoint missing
|
|
38
38
|
client.getPlayerBadges(playerId),
|
|
39
39
|
client.getRewards().catch(() => []), // Gracefully handle if rewards endpoint doesn't exist
|
|
40
40
|
]);
|
package/dist/hooks/usePoints.js
CHANGED
|
@@ -56,7 +56,7 @@ export function usePoints() {
|
|
|
56
56
|
}, [client, playerId]);
|
|
57
57
|
// Helper getters for common currencies
|
|
58
58
|
const xp = balances.find((b) => b.currency === 'xp')?.balance ?? 0;
|
|
59
|
-
const qwikCoins = balances.find((b) => b.currency === 'coins')?.balance ?? 0;
|
|
59
|
+
const qwikCoins = balances.find((b) => b.currency === 'qwik-coins')?.balance ?? 0;
|
|
60
60
|
return {
|
|
61
61
|
balances,
|
|
62
62
|
xp,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAMD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM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W,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAMD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playbasis-ai/qwikcard-sdk",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"description": "Playbasis SDK for QwikCard College Rewards - React Native gamification integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"registry": "https://registry.npmjs.org/"
|
|
85
85
|
}
|
|
86
|
-
}
|
|
86
|
+
}
|
package/src/QwikCardApp.tsx
CHANGED
|
@@ -49,8 +49,8 @@ function AppContent({ leaderboardId }: { leaderboardId?: string }) {
|
|
|
49
49
|
const [player, balances, quests, allBadges, playerBadges, rewards] = await Promise.all([
|
|
50
50
|
client.getPlayer(playerId),
|
|
51
51
|
client.getBalances(playerId),
|
|
52
|
-
client.getPlayerQuests(playerId),
|
|
53
|
-
client.getBadges(),
|
|
52
|
+
client.getPlayerQuests(playerId).catch(() => []), // Gracefully handle if endpoint missing
|
|
53
|
+
client.getBadges().catch(() => []), // Gracefully handle if endpoint missing
|
|
54
54
|
client.getPlayerBadges(playerId),
|
|
55
55
|
client.getRewards().catch(() => []), // Gracefully handle if rewards endpoint doesn't exist
|
|
56
56
|
]);
|
|
@@ -60,19 +60,19 @@ function AppContent({ leaderboardId }: { leaderboardId?: string }) {
|
|
|
60
60
|
|
|
61
61
|
const leaderboardEntries = leaderboardId
|
|
62
62
|
? await (async () => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
try {
|
|
64
|
+
const res = await client.getLeaderboard(leaderboardId, { limit: 50 });
|
|
65
|
+
return res.entries.map((e) => ({
|
|
66
|
+
userId: e.playerId,
|
|
67
|
+
rank: e.rank,
|
|
68
|
+
displayName: e.displayName,
|
|
69
|
+
score: e.score,
|
|
70
|
+
isCurrentUser: e.playerId === player.id,
|
|
71
|
+
}));
|
|
72
|
+
} catch {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
})()
|
|
76
76
|
: [];
|
|
77
77
|
|
|
78
78
|
return {
|
package/src/hooks/usePoints.ts
CHANGED
|
@@ -75,7 +75,7 @@ export function usePoints(): UsePointsReturn {
|
|
|
75
75
|
|
|
76
76
|
// Helper getters for common currencies
|
|
77
77
|
const xp = balances.find((b) => b.currency === 'xp')?.balance ?? 0;
|
|
78
|
-
const qwikCoins = balances.find((b) => b.currency === 'coins')?.balance ?? 0;
|
|
78
|
+
const qwikCoins = balances.find((b) => b.currency === 'qwik-coins')?.balance ?? 0;
|
|
79
79
|
|
|
80
80
|
return {
|
|
81
81
|
balances,
|
package/src/types/index.ts
CHANGED