@quiltt/react-native 3.9.7 → 4.0.1

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @quiltt/react-native
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#343](https://github.com/quiltt/quiltt-js/pull/343) [`da152b7`](https://github.com/quiltt/quiltt-js/commit/da152b7f42606defde5f55488632bcdc095be592) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add the ability to set nonce for the Quiltt SDK Script
8
+
9
+ - Updated dependencies [[`da152b7`](https://github.com/quiltt/quiltt-js/commit/da152b7f42606defde5f55488632bcdc095be592)]:
10
+ - @quiltt/react@4.0.1
11
+ - @quiltt/core@4.0.1
12
+
13
+ ## 4.0.0
14
+
15
+ ### Major Changes
16
+
17
+ - [#333](https://github.com/quiltt/quiltt-js/pull/333) [`5afca4a`](https://github.com/quiltt/quiltt-js/commit/5afca4a45f357afbb7f6af02088f86230f351e18) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Migrate to 'Navigate' message for URL handling
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [[`5afca4a`](https://github.com/quiltt/quiltt-js/commit/5afca4a45f357afbb7f6af02088f86230f351e18)]:
22
+ - @quiltt/core@4.0.0
23
+ - @quiltt/react@4.0.0
24
+
3
25
  ## 3.9.7
4
26
 
5
27
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -25,4 +25,5 @@ declare const QuilttConnector: {
25
25
  displayName: string;
26
26
  };
27
27
 
28
- export { type PreFlightCheck, QuilttConnector, checkConnectorUrl, handleOAuthUrl };
28
+ export { QuilttConnector, checkConnectorUrl, handleOAuthUrl };
29
+ export type { PreFlightCheck };
package/dist/index.js CHANGED
@@ -4,34 +4,30 @@ import { useQuilttSession, ConnectorSDKEventType } from '@quiltt/react';
4
4
  export { QuilttAuthProvider, QuilttProvider, QuilttSettingsProvider, useQuilttClient, useQuilttConnector, useQuilttSession, useQuilttSettings, useSession, useStorage } from '@quiltt/react';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
6
6
  import { useRef, useState, useCallback, useMemo, useEffect } from 'react';
7
- import { StyleSheet, Platform, StatusBar, SafeAreaView, View, Text, Pressable, ActivityIndicator, Linking } from 'react-native';
7
+ import { StyleSheet, StatusBar, Platform, SafeAreaView, View, Text, Pressable, ActivityIndicator, Linking } from 'react-native';
8
8
  import { URL } from 'react-native-url-polyfill';
9
9
  import { WebView } from 'react-native-webview';
10
10
  import { generateStackTrace, makeBacktrace, getCauses } from '@honeybadger-io/core/build/src/util';
11
11
 
12
- var version = "3.9.7";
12
+ var version = "4.0.1";
13
13
 
14
- const ErrorReporterConfig = {
15
- honeybadger_api_key: 'undefined'
16
- };
17
-
18
- // Quick hack to send error to Honeybadger to debug why the connector is not routable
14
+ // Custom Error Reporter to avoid hooking into or colliding with a client's Honeybadger singleton
19
15
  const notifier = {
20
16
  name: 'Quiltt React Native SDK Reporter',
21
- url: 'https://www.quiltt.dev/guides/connector/react-native',
17
+ url: 'https://www.quiltt.dev/connector/sdk/react-native',
22
18
  version: version
23
19
  };
24
20
  class ErrorReporter {
25
21
  constructor(platform){
26
22
  this.noticeUrl = 'https://api.honeybadger.io/v1/notices';
27
- this.apiKey = ErrorReporterConfig.honeybadger_api_key;
23
+ this.apiKey = process.env.HONEYBADGER_API_KEY_REACT_NATIVE || '';
28
24
  this.clientName = 'react-native-sdk';
29
25
  this.clientVersion = version;
30
26
  this.platform = platform;
31
27
  this.logger = console;
32
28
  this.userAgent = `${this.clientName} ${this.clientVersion}; ${this.platform}`;
33
29
  }
34
- async send(error, context) {
30
+ async notify(error, context) {
35
31
  const headers = {
36
32
  'X-API-Key': this.apiKey,
37
33
  'Content-Type': 'application/json',
@@ -287,7 +283,7 @@ const checkConnectorUrl = async (connectorUrl, retryCount = 0)=>{
287
283
  connectorUrl,
288
284
  responseStatus
289
285
  };
290
- if (responseStatus !== 404) await errorReporter.send(errorToSend, context);
286
+ if (responseStatus !== 404) await errorReporter.notify(errorToSend, context);
291
287
  return {
292
288
  checked: true,
293
289
  error: errorMessage
@@ -456,27 +452,28 @@ const QuilttConnector = ({ testId, connectorId, connectionId, institution, oauth
456
452
  case 'Authenticate':
457
453
  console.log('Event: Authenticate');
458
454
  break;
459
- case 'OauthRequested':
455
+ case 'Navigate':
460
456
  {
461
- console.log('Event: OauthRequested');
462
- const oauthUrl = url.searchParams.get('oauthUrl');
463
- if (oauthUrl) {
464
- if (isEncoded(oauthUrl)) {
457
+ console.log('Event: Navigate');
458
+ const navigateUrl = url.searchParams.get('url');
459
+ if (navigateUrl) {
460
+ if (isEncoded(navigateUrl)) {
465
461
  try {
466
- const decodedUrl = decodeURIComponent(oauthUrl);
462
+ const decodedUrl = decodeURIComponent(navigateUrl);
467
463
  handleOAuthUrl(decodedUrl);
468
464
  } catch (error) {
469
- console.error('OAuth URL decoding failed, using original');
470
- handleOAuthUrl(oauthUrl);
465
+ console.error('Navigate URL decoding failed, using original');
466
+ handleOAuthUrl(navigateUrl);
471
467
  }
472
468
  } else {
473
- handleOAuthUrl(oauthUrl);
469
+ handleOAuthUrl(navigateUrl);
474
470
  }
475
471
  } else {
476
- console.error('OAuth URL missing from request');
472
+ console.error('Navigate URL missing from request');
477
473
  }
478
474
  break;
479
475
  }
476
+ // NOTE: The `OauthRequested` is deprecated and should not be used
480
477
  default:
481
478
  console.log(`Unhandled event: ${eventType}`);
482
479
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quiltt/react-native",
3
- "version": "3.9.7",
3
+ "version": "4.0.1",
4
4
  "description": "React Native Components for Quiltt Connector",
5
5
  "homepage": "https://github.com/quiltt/quiltt-js/tree/main/packages/react-native#readme",
6
6
  "repository": {
@@ -30,15 +30,15 @@
30
30
  "dependencies": {
31
31
  "@honeybadger-io/core": "6.6.0",
32
32
  "lodash.debounce": "4.0.8",
33
- "@quiltt/core": "3.9.7",
34
- "@quiltt/react": "3.9.7"
33
+ "@quiltt/core": "4.0.1",
34
+ "@quiltt/react": "4.0.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@biomejs/biome": "1.9.4",
38
38
  "@types/base-64": "1.0.2",
39
39
  "@types/lodash.debounce": "4.0.9",
40
- "@types/node": "22.13.10",
41
- "@types/react": "18.3.12",
40
+ "@types/node": "22.14.1",
41
+ "@types/react": "18.3.20",
42
42
  "base-64": "1.0.0",
43
43
  "bunchee": "6.3.4",
44
44
  "react": "18.3.1",
@@ -46,7 +46,7 @@
46
46
  "react-native-url-polyfill": "2.0.0",
47
47
  "react-native-webview": "13.12.5",
48
48
  "rimraf": "6.0.1",
49
- "typescript": "5.7.3"
49
+ "typescript": "5.8.2"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "base-64": "^1.0.0",
@@ -63,8 +63,7 @@
63
63
  "access": "public"
64
64
  },
65
65
  "scripts": {
66
- "addApiKey": "node scripts/addApiKey.js",
67
- "build": "pnpm run addApiKey && bunchee",
66
+ "build": "bunchee",
68
67
  "clean": "rimraf .turbo dist",
69
68
  "dev": "bunchee --watch",
70
69
  "lint": "TIMING=1 biome check src/ tests/ --fix",
@@ -54,7 +54,7 @@ export const checkConnectorUrl = async (
54
54
  const errorMessage = getErrorMessage(responseStatus, error as Error)
55
55
  const errorToSend = (error as Error) || new Error(errorMessage)
56
56
  const context = { connectorUrl, responseStatus }
57
- if (responseStatus !== 404) await errorReporter.send(errorToSend, context)
57
+ if (responseStatus !== 404) await errorReporter.notify(errorToSend, context)
58
58
  return { checked: true, error: errorMessage }
59
59
  }
60
60
  }
@@ -247,27 +247,28 @@ const QuilttConnector = ({
247
247
  console.log('Event: Authenticate')
248
248
  // TODO: handle Authenticate
249
249
  break
250
- case 'OauthRequested': {
251
- console.log('Event: OauthRequested')
252
- const oauthUrl = url.searchParams.get('oauthUrl')
250
+ case 'Navigate': {
251
+ console.log('Event: Navigate')
252
+ const navigateUrl = url.searchParams.get('url')
253
253
 
254
- if (oauthUrl) {
255
- if (isEncoded(oauthUrl)) {
254
+ if (navigateUrl) {
255
+ if (isEncoded(navigateUrl)) {
256
256
  try {
257
- const decodedUrl = decodeURIComponent(oauthUrl)
257
+ const decodedUrl = decodeURIComponent(navigateUrl)
258
258
  handleOAuthUrl(decodedUrl)
259
259
  } catch (error) {
260
- console.error('OAuth URL decoding failed, using original')
261
- handleOAuthUrl(oauthUrl)
260
+ console.error('Navigate URL decoding failed, using original')
261
+ handleOAuthUrl(navigateUrl)
262
262
  }
263
263
  } else {
264
- handleOAuthUrl(oauthUrl)
264
+ handleOAuthUrl(navigateUrl)
265
265
  }
266
266
  } else {
267
- console.error('OAuth URL missing from request')
267
+ console.error('Navigate URL missing from request')
268
268
  }
269
269
  break
270
270
  }
271
+ // NOTE: The `OauthRequested` is deprecated and should not be used
271
272
  default:
272
273
  console.log(`Unhandled event: ${eventType}`)
273
274
  break
@@ -1,13 +1,12 @@
1
- // Quick hack to send error to Honeybadger to debug why the connector is not routable
1
+ // Custom Error Reporter to avoid hooking into or colliding with a client's Honeybadger singleton
2
2
  import type { Notice, NoticeTransportPayload } from '@honeybadger-io/core/build/src/types'
3
3
  import { generateStackTrace, getCauses, makeBacktrace } from '@honeybadger-io/core/build/src/util'
4
4
 
5
5
  import { version } from '@/version'
6
- import { ErrorReporterConfig } from './ErrorReporterConfig'
7
6
 
8
7
  const notifier = {
9
8
  name: 'Quiltt React Native SDK Reporter',
10
- url: 'https://www.quiltt.dev/guides/connector/react-native',
9
+ url: 'https://www.quiltt.dev/connector/sdk/react-native',
11
10
  version: version,
12
11
  }
13
12
 
@@ -26,7 +25,7 @@ class ErrorReporter {
26
25
 
27
26
  constructor(platform: string) {
28
27
  this.noticeUrl = 'https://api.honeybadger.io/v1/notices'
29
- this.apiKey = ErrorReporterConfig.honeybadger_api_key
28
+ this.apiKey = process.env.HONEYBADGER_API_KEY_REACT_NATIVE || ''
30
29
  this.clientName = 'react-native-sdk'
31
30
  this.clientVersion = version
32
31
  this.platform = platform
@@ -34,7 +33,7 @@ class ErrorReporter {
34
33
  this.userAgent = `${this.clientName} ${this.clientVersion}; ${this.platform}`
35
34
  }
36
35
 
37
- async send(error: Error, context?: any): Promise<void> {
36
+ async notify(error: Error, context?: any): Promise<void> {
38
37
  const headers = {
39
38
  'X-API-Key': this.apiKey,
40
39
  'Content-Type': 'application/json',
@@ -1,3 +0,0 @@
1
- export const ErrorReporterConfig = {
2
- honeybadger_api_key: 'undefined',
3
- }