@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.
@@ -28,7 +28,7 @@ export const getWidgetHtml = () => {
28
28
  /* Widget root container - CRITICAL for init() */
29
29
  #pb-widget-root {
30
30
  width: 100%;
31
- min-height: 100vh;
31
+ min-height: 100%;
32
32
  max-width: 100vw;
33
33
  overflow-x: hidden;
34
34
  position: relative;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playbasis-ai/qwikcard-sdk",
3
- "version": "2.3.10",
3
+ "version": "2.3.12",
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",
@@ -29,6 +29,17 @@ interface PlaybasisProviderProps {
29
29
  baseUrl?: string;
30
30
  }
31
31
 
32
+ const QWIK_BASE_URLS = {
33
+ production: 'https://apim-pb-production.azure-api.net/v1',
34
+ staging: 'https://apim-pb-staging.azure-api.net/playbasis/v1',
35
+ };
36
+
37
+ const resolveBaseUrl = (tenantId: string, baseUrl?: string) => {
38
+ if (baseUrl) return baseUrl;
39
+ if (tenantId.toLowerCase().includes('prod')) return QWIK_BASE_URLS.production;
40
+ return QWIK_BASE_URLS.staging;
41
+ };
42
+
32
43
  // ─────────────────────────────────────────────────────────────────────────────
33
44
  // Provider Component
34
45
  // ─────────────────────────────────────────────────────────────────────────────
@@ -36,18 +47,26 @@ interface PlaybasisProviderProps {
36
47
  export function PlaybasisProvider({
37
48
  children,
38
49
  apiKey,
39
- tenantId = 'qwikcard',
50
+ tenantId,
40
51
  playerId,
41
- baseUrl = 'https://apim-pb-production.azure-api.net/v1',
52
+ baseUrl,
42
53
  }: PlaybasisProviderProps) {
54
+ const resolvedTenantId =
55
+ tenantId ?? (baseUrl && baseUrl.includes('production') ? 'qwik-prod' : 'qwikcard');
56
+ const resolvedBaseUrl = resolveBaseUrl(resolvedTenantId, baseUrl);
43
57
  const client = useMemo(
44
- () => new PlaybasisClient({ apiKey, tenantId, baseUrl }),
45
- [apiKey, tenantId, baseUrl],
58
+ () => new PlaybasisClient({ apiKey, tenantId: resolvedTenantId, baseUrl: resolvedBaseUrl }),
59
+ [apiKey, resolvedTenantId, resolvedBaseUrl],
46
60
  );
47
61
 
48
62
  const value = useMemo(
49
- () => ({ client, tenantId, playerId: playerId ?? null, baseUrl }),
50
- [client, tenantId, playerId, baseUrl],
63
+ () => ({
64
+ client,
65
+ tenantId: resolvedTenantId,
66
+ playerId: playerId ?? null,
67
+ baseUrl: resolvedBaseUrl,
68
+ }),
69
+ [client, resolvedTenantId, playerId, resolvedBaseUrl],
51
70
  );
52
71
 
53
72
  return (