@playbasis-ai/qwikcard-sdk 2.3.6 → 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.
@@ -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 @foremost-ai/qwikcard-sdk
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 '@foremost-ai/qwikcard-sdk';
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.com" // optional
70
+ baseUrl="https://apim-pb-staging.azure-api.net/playbasis/v1" // optional
71
71
  leaderboardId="YOUR_LEADERBOARD_ID" // optional
72
72
  />
73
73
  );
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playbasis-ai/qwikcard-sdk",
3
- "version": "2.3.6",
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",
@@ -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
- 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
- })()
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 {