react-native-plaid-link-sdk 11.6.0 → 11.7.0

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/README.md CHANGED
@@ -54,36 +54,82 @@ AutoLinking should handle all of the Android setup.
54
54
 
55
55
  - To initialize `PlaidLink`, you will need to first create a `link_token` at [/link/token/create](https://plaid.com/docs/#create-link-token). Check out our [QuickStart guide](https://plaid.com/docs/quickstart/#introduction) for additional API information.
56
56
 
57
- - After creating a `link_token`, you'll need to pass it into your app and use it to launch Link:
57
+ #### Version >= 11.6.0
58
+
59
+ Starting from version `11.6.0`, we introduced the ability to preload part of the Link experience. You can initiate the preloading process by invoking the `create` function.
60
+
61
+ ```typescript
62
+ function createLinkTokenConfiguration(
63
+ token: string,
64
+ noLoadingState: boolean = false,
65
+ ): LinkTokenConfiguration {
66
+ return {
67
+ token: token,
68
+ // Hides native activity indicator if true.
69
+ noLoadingState: noLoadingState,
70
+ };
71
+ }
58
72
 
59
- ```javascript
60
- import { Text } from 'react-native';
61
- import { PlaidLink, LinkSuccess, LinkExit, LinkLogLevel, LinkIOSPresentationStyle } from 'react-native-plaid-link-sdk';
62
-
63
- const MyPlaidComponent = () => {
64
- return (
65
- <PlaidLink
66
- tokenConfig={{
67
- token: "#GENERATED_LINK_TOKEN#",
68
- // OPTIONAL - log level.
69
- logLevel: LinkLogLevel.ERROR,
70
- // OPTIONAL - A `Bool` indicating that Link should skip displaying a loading animation until the Link UI is fully loaded.
71
- // See Types.ts for more information.
72
- noLoadingState: false,
73
- }}
74
- onSuccess={(success: LinkSuccess) => { console.log(success) }}
75
- onExit={(exit: LinkExit) => { console.log(exit) }}
76
- // OPTIONAL - MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
77
- // UI is always presented in full screen on Android.
78
- iOSPresentationStyle={LinkIOSPresentationStyle.MODAL}
79
- >
80
- <Text>Add Account</Text>
81
- </PlaidLink>
82
- );
83
- };
73
+ const tokenConfiguration = createLinkTokenConfiguration("#GENERATED_LINK_TOKEN#");
74
+ create(tokenConfiguration);
75
+ ```
76
+
77
+ After calling `create`, you can subsequently invoke the `open` function. Note that maximizing the delay between these two calls will reduce latency for your users by allowing Link more time to load.
78
+
79
+ ```typescript
80
+ function createLinkOpenProps(): LinkOpenProps {
81
+ return {
82
+ onSuccess: (success: LinkSuccess) => {
83
+ // User was able to successfully link their account.
84
+ console.log('Success: ', success);
85
+ },
86
+ onExit: (linkExit: LinkExit) => {
87
+ // User exited Link session. There may or may not be an error depending on what occured.
88
+ console.log('Exit: ', linkExit);
89
+ dismissLink();
90
+ },
91
+ // MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
92
+ iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
93
+ logLevel: LinkLogLevel.ERROR,
94
+ };
95
+ }
96
+
97
+ const openProps = createLinkOpenProps();
98
+ open(openProps);
84
99
  ```
85
100
 
86
- `PlaidLink` wraps the view you provide as a child with a `Pressable` component and intercepts the `onPress` event.
101
+ #### Version < 11.6.0
102
+
103
+ In versions prior to `11.6.0`, you can open a link by calling the `openLink` function.
104
+
105
+ ```typescript
106
+ // Create PlaidLinkProps from the provided token string.
107
+ function makeLinkTokenProps(token: string): PlaidLinkProps {
108
+ return {
109
+ tokenConfig: {
110
+ token: token,
111
+ logLevel: LinkLogLevel.ERROR,
112
+ // Hides native activity indicator if true.
113
+ noLoadingState: false,
114
+ },
115
+ onSuccess: (success: LinkSuccess) => {
116
+ // User was able to successfully link their account.
117
+ console.log('Success: ', success);
118
+ success.metadata.accounts.forEach(it => console.log('accounts', it));
119
+ },
120
+ onExit: (linkExit: LinkExit) => {
121
+ // User exited Link session. There may or may not be an error depending on what occured.
122
+ console.log('Exit: ', linkExit);
123
+ dismissLink();
124
+ },
125
+ // MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
126
+ iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
127
+ };
128
+ }
129
+
130
+ const linkTokenProps = makeLinkTokenProps("#GENERATED_LINK_TOKEN#");
131
+ openLink(linkTokenProps);
132
+ ```
87
133
 
88
134
  #### OAuth requirements
89
135
 
@@ -113,30 +159,7 @@ For iOS OAuth to work, specific requirements must be met.
113
159
 
114
160
  #### To receive onEvent callbacks:
115
161
 
116
- The React Native Plaid module emits `onEvent` events throughout the account linking process — see [details here](https://plaid.com/docs/link/react-native/#onevent). To receive these events in your React Native app, wrap the `PlaidLink` react component with the following in order to listen for those events:
117
-
118
- ```javascript
119
- import React from 'react';
120
- import { Text, NativeEventEmitter, NativeModules, Platform } from 'react-native';
121
-
122
- class PlaidEventContainer extends React.Component {
123
-
124
- componentDidMount() {
125
- const emitter = new NativeEventEmitter(Platform.OS === 'ios' ? NativeModules.RNLinksdk : NativeModules.PlaidAndroid);
126
- this._listener = emitter.addListener('onEvent', (e) => console.log(e));
127
- }
128
-
129
- componentWillUnmount() {
130
- if (this._listener) {
131
- this._listener.remove();
132
- }
133
- }
134
-
135
- ...
136
- }
137
- ```
138
-
139
- You can also use the `usePlaidEmitter` hook in react functional components:
162
+ The React Native Plaid module emits `onEvent` events throughout the account linking process — see [details here](https://plaid.com/docs/link/react-native/#onevent). To receive these events in your React Native app, use the `usePlaidEmitter` hook in react functional components:
140
163
 
141
164
  ```javascript
142
165
  usePlaidEmitter((event: LinkEvent) => {
@@ -156,18 +179,19 @@ While these older versions are expected to continue to work without disruption,
156
179
 
157
180
  | Plaid SDK Version | Min React Native Version | Android SDK | Android Min Version | Android Compile Version| iOS SDK | iOS Min Version | Status |
158
181
  |-------------------|--------------------------|-------------|---------------------|------------------------|---------|-----------------|-------------------------------|
159
- | 11.6.0 | * | [4.2.0+] | 21 | 33 | >=5.3.1 | 14.0 | Active, supports Xcode 15.0.1 |
160
- | 11.5.2 | * | [4.1.1+] | 21 | 33 | >=5.2.1 | 14.0 | Active, supports Xcode 15.0.1 |
161
- | 11.5.1 | * | [4.1.1+] | 21 | 33 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
162
- | 11.5.0 | * | [4.1.1+] | 21 | 33 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
163
- | 11.4.0 | * | [4.1.1+] | 21 | 33 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
164
- | 11.3.0 | * | [4.0.0+] | 21 | 33 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
165
- | ~11.2.0~ | * | [4.1.0+] | 21 | 33 | >=5.1.0 | 14.0 | **Deprecated** |
166
- | 11.1.0 | * | [4.0.0+] | 21 | 33 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
167
- | 11.0.3 | * | [4.0.0+] | 21 | 33 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
168
- | 11.0.2 | * | [4.0.0+] | 21 | 33 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
169
- | 11.0.1 | * | [4.0.0+] | 21 | 33 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
170
- | 11.0.0 | * | [4.0.0+] | 21 | 33 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
182
+ | 11.7.0 | * | [4.3.0+] | 21 | 34 | >=5.4.0 | 14.0 | Active, supports Xcode 15.0.1 |
183
+ | 11.6.0 | * | [4.2.0+] | 21 | 34 | >=5.3.1 | 14.0 | Active, supports Xcode 15.0.1 |
184
+ | 11.5.2 | * | [4.1.1+] | 21 | 34 | >=5.2.1 | 14.0 | Active, supports Xcode 15.0.1 |
185
+ | 11.5.1 | * | [4.1.1+] | 21 | 34 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
186
+ | 11.5.0 | * | [4.1.1+] | 21 | 34 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
187
+ | 11.4.0 | * | [4.1.1+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
188
+ | 11.3.0 | * | [4.0.0+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
189
+ | ~11.2.0~ | * | [4.1.0+] | 21 | 34 | >=5.1.0 | 14.0 | **Deprecated** |
190
+ | 11.1.0 | * | [4.0.0+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
191
+ | 11.0.3 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
192
+ | 11.0.2 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
193
+ | 11.0.1 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
194
+ | 11.0.0 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
171
195
  | 10.13.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.2 | 11.0 | Active, supports Xcode 14 |
172
196
  | 10.12.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
173
197
  | 10.11.0 | >= 0.66.0 | [3.14.1+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
@@ -70,7 +70,7 @@ repositories {
70
70
 
71
71
  dependencies {
72
72
  implementation "com.facebook.react:react-native:+"
73
- implementation "com.plaid.link:sdk-core:4.2.0"
73
+ implementation "com.plaid.link:sdk-core:4.3.0"
74
74
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
75
75
  implementation "com.jakewharton.rxrelay2:rxrelay:2.1.1"
76
76
  }
@@ -4,7 +4,7 @@
4
4
  <application>
5
5
  <meta-data
6
6
  android:name="com.plaid.link.react_native"
7
- android:value="11.6.0" />
7
+ android:value="11.7.0" />
8
8
  </application>
9
9
 
10
10
  </manifest>
package/dist/PlaidLink.js CHANGED
@@ -84,10 +84,10 @@ export const dismissLink = () => {
84
84
  * @deprecated This component is deprecated. Create your own component and use the create & open methods.
85
85
  */
86
86
  export const PlaidLink = (props) => {
87
- // Create a handler.
88
- create(props.tokenConfig);
89
87
  function onPress() {
90
88
  var _a;
89
+ // Create a handler.
90
+ create(props.tokenConfig);
91
91
  (_a = props.onPress) === null || _a === void 0 ? void 0 : _a.call(props);
92
92
  const openProps = {
93
93
  onSuccess: props.onSuccess,
package/ios/RNLinksdk.m CHANGED
@@ -27,7 +27,7 @@ static NSString* const kRNLinkKitVersionConstant = @"version";
27
27
  RCT_EXPORT_MODULE();
28
28
 
29
29
  + (NSString*)sdkVersion {
30
- return @"11.6.0"; // SDK_VERSION
30
+ return @"11.7.0"; // SDK_VERSION
31
31
  }
32
32
 
33
33
  + (NSString*)objCBridgeVersion {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-plaid-link-sdk",
3
- "version": "11.6.0",
3
+ "version": "11.7.0",
4
4
  "description": "React Native Plaid Link SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/*.{h,m,swift}"
17
17
 
18
18
  s.dependency 'React-Core'
19
- s.dependency 'Plaid', '~> 5.3.1'
19
+ s.dependency 'Plaid', '~> 5.4.0'
20
20
  end