@playbasis-ai/qwikcard-sdk 2.3.7 → 2.3.9
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 +18 -0
- package/README.md +3 -3
- package/SDK_HANDOVER_GUIDE.md +8 -9
- 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/dist/web/widgetAssets.d.ts +2 -2
- package/dist/web/widgetAssets.d.ts.map +1 -1
- package/dist/web/widgetAssets.js +2 -2
- package/package.json +6 -6
- package/src/QwikCardApp.tsx +15 -15
- package/src/hooks/usePoints.ts +1 -1
- package/src/types/index.ts +1 -1
- package/src/web/widgetAssets.ts +5 -3
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.9",
|
|
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",
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"license": "MIT",
|
|
74
74
|
"repository": {
|
|
75
75
|
"type": "git",
|
|
76
|
-
"url": "https://github.com/
|
|
76
|
+
"url": "https://github.com/Playbasis/playbasis-platform.git",
|
|
77
77
|
"directory": "client-sdks/qwikcard-sdk-v1.3.0-pkg"
|
|
78
78
|
},
|
|
79
79
|
"bugs": {
|
|
80
|
-
"url": "https://github.com/
|
|
80
|
+
"url": "https://github.com/Playbasis/playbasis-platform/issues"
|
|
81
81
|
},
|
|
82
|
-
"homepage": "https://github.com/
|
|
82
|
+
"homepage": "https://github.com/Playbasis/playbasis-platform/tree/main/client-sdks/qwikcard-sdk-v1.3.0-pkg#readme",
|
|
83
83
|
"publishConfig": {
|
|
84
|
-
"registry": "https://registry.npmjs.org
|
|
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),
|
|
53
|
+
client.getBadges(),
|
|
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 === '
|
|
78
|
+
const qwikCoins = balances.find((b) => b.currency === 'coins')?.balance ?? 0;
|
|
79
79
|
|
|
80
80
|
return {
|
|
81
81
|
balances,
|
package/src/types/index.ts
CHANGED