@explorins/pers-sdk-react-native 1.5.12 → 1.5.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorins/pers-sdk-react-native",
3
- "version": "1.5.12",
3
+ "version": "1.5.13",
4
4
  "description": "React Native SDK for PERS Platform - Tourism Loyalty System with Manager Pattern Architecture",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -268,6 +268,26 @@ export const useTransactionSigner = () => {
268
268
  await (PersService as any).initializeTenant(config.tenantId, authToken);
269
269
  console.log('[useTransactionSigner] Tenant initialized successfully');
270
270
 
271
+ // Get tenant data to extract project key manually
272
+ try {
273
+ const tenantData = await (PersService as any).getTenantById(config.tenantId, authToken);
274
+ console.log('[useTransactionSigner] Tenant data retrieved:', tenantData);
275
+
276
+ // Extract and set project key manually if initializeTenant didn't set it
277
+ const projectKey = tenantData.projectApiKey || tenantData.projectKey || tenantData.apiKey;
278
+ if (projectKey) {
279
+ console.log('[useTransactionSigner] Setting project key manually:', projectKey);
280
+ (PersService as any).configure({
281
+ token: authToken,
282
+ projectKey: projectKey
283
+ });
284
+ } else {
285
+ console.warn('[useTransactionSigner] No project key found in tenant data:', tenantData);
286
+ }
287
+ } catch (tenantError) {
288
+ console.error('[useTransactionSigner] Failed to retrieve tenant data for project key:', tenantError);
289
+ }
290
+
271
291
  // Verify configuration
272
292
  const persConfig = (PersService as any).getConfig();
273
293
  console.log('[useTransactionSigner] PERS service config after tenant initialization:', persConfig);