@explorins/pers-sdk-react-native 1.5.5 → 1.5.6

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.5",
3
+ "version": "1.5.6",
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",
@@ -134,7 +134,9 @@ export const useTransactionSigner = () => {
134
134
 
135
135
  // Get configuration from the PERS SDK
136
136
  const sdkConfig = (sdk as any).config || {};
137
+ console.log('[useTransactionSigner] SDK config:', sdkConfig);
137
138
  const apiProjectKey = sdkConfig.apiProjectKey || 'demo-project-key';
139
+ console.log('[useTransactionSigner] Extracted API project key:', apiProjectKey);
138
140
  const tenantId = sdkConfig.tenantId || 'vq-demo';
139
141
 
140
142
  initializeSigner({
@@ -179,12 +181,21 @@ export const useTransactionSigner = () => {
179
181
  // Configure the PERS service with the project key before creating SDK
180
182
  if (config?.projectKey) {
181
183
  console.log('[useTransactionSigner] Configuring PERS service with project key:', config.projectKey);
182
- // Import and configure the PERS service
183
- const { PersService } = await import('@explorins/pers-signer/react-native');
184
- (PersService as any).configure({
185
- projectKey: config.projectKey
186
- });
187
- console.log('[useTransactionSigner] PERS service configured with project key');
184
+ try {
185
+ // Import and configure the PERS service
186
+ const { PersService } = await import('@explorins/pers-signer/react-native');
187
+ console.log('[useTransactionSigner] PersService imported successfully');
188
+ (PersService as any).configure({
189
+ projectKey: config.projectKey
190
+ });
191
+ console.log('[useTransactionSigner] PERS service configured with project key');
192
+
193
+ // Verify configuration
194
+ const persConfig = (PersService as any).getConfig();
195
+ console.log('[useTransactionSigner] PERS service config after configuration:', persConfig);
196
+ } catch (configError) {
197
+ console.error('[useTransactionSigner] Failed to configure PERS service:', configError);
198
+ }
188
199
  }
189
200
 
190
201
  const signerSDK = await createPersSignerSDK({
@@ -254,7 +265,9 @@ export const useTransactionSigner = () => {
254
265
 
255
266
  // Get PERS access token from the main SDK
256
267
  const authProvider = (sdk as any).authProvider || (sdk as any)._authProvider;
268
+ console.log('[useTransactionSigner] Auth provider found:', !!authProvider);
257
269
  const persAccessToken = authProvider ? await authProvider.getToken() : '';
270
+ console.log('[useTransactionSigner] PERS access token extracted:', persAccessToken ? 'Token found' : 'No token');
258
271
 
259
272
  // Authenticate user with blockchain signer and pass PERS token
260
273
  console.log('[useTransactionSigner] Authenticating user with signer:', signerUserInfo.identifier);