react-native-plaid-link-sdk 12.6.1 → 12.8.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
@@ -215,6 +215,8 @@ If migrating from older versions, see the [docs](https://plaid.com/docs/link/rea
215
215
 
216
216
  | Plaid SDK Version | Min React Native Version | Android SDK | Android Min Version | Android Compile Version| iOS SDK | iOS Min Version | Status |
217
217
  |-------------------|--------------------------|-------------|---------------------|------------------------|---------|-----------------|-------------------------------|
218
+ | 12.8.0 | * | [5.5.1+] | 21 | 34 | >=6.4.3 | 14.0 | Active, supports Xcode 16.1.0 |
219
+ | 12.7.0 | * | [5.5.0+] | 21 | 34 | >=6.4.2 | 14.0 | Active, supports Xcode 16.1.0 |
218
220
  | 12.6.1 | * | [5.4.0+] | 21 | 34 | >=6.4.2 | 14.0 | Active, supports Xcode 16.1.0 |
219
221
  | 12.6.0 | * | [5.4.0+] | 21 | 34 | >=6.4.1 | 14.0 | Active, supports Xcode 16.1.0 |
220
222
  | 12.5.3 | * | [5.3.4+] | 21 | 34 | >=6.4.0 | 14.0 | Active, supports Xcode 16.1.0 |
@@ -106,6 +106,6 @@ repositories {
106
106
 
107
107
  dependencies {
108
108
  implementation "com.facebook.react:react-native:+"
109
- implementation "com.plaid.link:sdk-core:5.4.0"
109
+ implementation "com.plaid.link:sdk-core:5.5.1"
110
110
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
111
111
  }
@@ -4,7 +4,7 @@
4
4
  <application>
5
5
  <meta-data
6
6
  android:name="com.plaid.link.react_native"
7
- android:value="12.6.1" />
7
+ android:value="12.8.0" />
8
8
  </application>
9
9
 
10
10
  </manifest>
@@ -12,11 +12,13 @@ import com.facebook.react.bridge.Callback
12
12
  import com.facebook.react.bridge.Promise
13
13
  import com.facebook.react.bridge.ReactApplicationContext
14
14
  import com.facebook.react.bridge.ReactMethod
15
+ import com.facebook.react.bridge.ReadableMap
15
16
  import com.facebook.react.module.annotations.ReactModule
16
17
  import com.facebook.react.modules.core.DeviceEventManagerModule
17
18
  import com.plaid.gson.PlaidJsonConverter
18
19
  import com.plaid.link.Plaid
19
20
  import com.plaid.link.PlaidHandler
21
+ import com.plaid.link.OnLoadCallback
20
22
  import com.plaid.link.configuration.LinkLogLevel
21
23
  import com.plaid.link.configuration.LinkTokenConfiguration
22
24
  import com.plaid.link.event.LinkEvent
@@ -83,11 +85,18 @@ class PlaidModule internal constructor(reactContext: ReactApplicationContext) :
83
85
  }
84
86
 
85
87
  @ReactMethod
86
- override fun submit(phoneNumber: String?, dateOfBirth: String?) {
88
+ override fun submit(phoneNumber: String?, dateOfBirth: String?, params: ReadableMap?) {
87
89
  if (plaidHandler != null) {
90
+ val paramsMap: Map<String, String>? = params?.let { map ->
91
+ map.toHashMap().mapNotNull { (key, value) ->
92
+ if (value is String) key to value else null
93
+ }.toMap()
94
+ }
95
+
88
96
  val submissionData = SubmissionData(
89
97
  phoneNumber = phoneNumber,
90
- dateOfBirth = dateOfBirth
98
+ dateOfBirth = dateOfBirth,
99
+ params = paramsMap
91
100
  )
92
101
  plaidHandler?.submit(submissionData)
93
102
  }
@@ -98,6 +107,7 @@ class PlaidModule internal constructor(reactContext: ReactApplicationContext) :
98
107
  token: String,
99
108
  noLoadingState: Boolean,
100
109
  logLevel: String,
110
+ onLoad: Callback,
101
111
  ) {
102
112
  val tokenConfiguration = getLinkTokenConfiguration(token, noLoadingState, getLogLevel(logLevel))
103
113
  if (tokenConfiguration == null) {
@@ -120,7 +130,14 @@ class PlaidModule internal constructor(reactContext: ReactApplicationContext) :
120
130
  // Create Plaid handler.
121
131
  this.plaidHandler = Plaid.create(
122
132
  reactApplicationContext.getApplicationContext() as Application,
123
- tokenConfiguration
133
+ tokenConfiguration,
134
+ onLoad = OnLoadCallback {
135
+ try {
136
+ onLoad.invoke()
137
+ } catch (e: Exception) {
138
+ Log.e("PlaidModule", "onLoad callback failed", e)
139
+ }
140
+ }
124
141
  )
125
142
  }
126
143
 
@@ -18,6 +18,7 @@ import com.facebook.react.bridge.Promise;
18
18
  import com.facebook.react.bridge.ReactApplicationContext;
19
19
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
20
20
  import com.facebook.react.bridge.ReactMethod;
21
+ import com.facebook.react.bridge.ReadableMap;
21
22
  import com.facebook.react.turbomodule.core.interfaces.TurboModule;
22
23
  import javax.annotation.Nonnull;
23
24
 
@@ -35,7 +36,7 @@ public abstract class NativePlaidLinkModuleAndroidSpec extends ReactContextBaseJ
35
36
 
36
37
  @ReactMethod
37
38
  @DoNotStrip
38
- public abstract void createPlaidLink(String token, boolean noLoadingState, String logLevel);
39
+ public abstract void createPlaidLink(String token, boolean noLoadingState, String logLevel, Callback onLoad);
39
40
 
40
41
  @ReactMethod
41
42
  @DoNotStrip
@@ -51,7 +52,7 @@ public abstract class NativePlaidLinkModuleAndroidSpec extends ReactContextBaseJ
51
52
 
52
53
  @ReactMethod
53
54
  @DoNotStrip
54
- public abstract void submit(String phoneNumber, String dateOfBirth);
55
+ public abstract void submit(String phoneNumber, String dateOfBirth, ReadableMap params);
55
56
 
56
57
  @ReactMethod
57
58
  @DoNotStrip
@@ -17,6 +17,7 @@ import com.facebook.react.bridge.Callback;
17
17
  import com.facebook.react.bridge.ReactApplicationContext;
18
18
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
19
  import com.facebook.react.bridge.ReactMethod;
20
+ import com.facebook.react.bridge.ReadableMap;
20
21
  import com.facebook.react.turbomodule.core.interfaces.TurboModule;
21
22
  import javax.annotation.Nonnull;
22
23
 
@@ -46,7 +47,7 @@ public abstract class NativePlaidLinkModuleiOSSpec extends ReactContextBaseJavaM
46
47
 
47
48
  @ReactMethod
48
49
  @DoNotStrip
49
- public abstract void submit(String phoneNumber);
50
+ public abstract void submit(String phoneNumber, String dateOfBirth, ReadableMap params);
50
51
 
51
52
  @ReactMethod
52
53
  @DoNotStrip
package/dist/PlaidLink.js CHANGED
@@ -31,14 +31,15 @@ export const usePlaidEmitter = (linkEventListener) => {
31
31
  }, []);
32
32
  };
33
33
  export const create = (props) => {
34
- var _a, _b;
34
+ var _a, _b, _c, _d;
35
35
  let token = props.token;
36
36
  let noLoadingState = (_a = props.noLoadingState) !== null && _a !== void 0 ? _a : false;
37
37
  if (Platform.OS === 'android') {
38
- RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.createPlaidLink(token, noLoadingState, (_b = props.logLevel) !== null && _b !== void 0 ? _b : LinkLogLevel.ERROR);
38
+ RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.createPlaidLink(token, noLoadingState, (_b = props.logLevel) !== null && _b !== void 0 ? _b : LinkLogLevel.ERROR, (_c = props.onLoad) !== null && _c !== void 0 ? _c : (() => { }));
39
39
  }
40
40
  else {
41
- RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.createPlaidLink(token, noLoadingState);
41
+ const onLoad = (_d = props.onLoad) !== null && _d !== void 0 ? _d : (() => { });
42
+ RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.createPlaidLink(token, noLoadingState, onLoad);
42
43
  }
43
44
  };
44
45
  export const open = (props) => {
@@ -95,10 +96,10 @@ export const dismissLink = () => {
95
96
  };
96
97
  export const submit = (data) => {
97
98
  if (Platform.OS === 'android') {
98
- RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.submit(data.phoneNumber, data.dateOfBirth);
99
+ RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.submit(data.phoneNumber, data.dateOfBirth, data.params);
99
100
  }
100
101
  else {
101
- RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.submit(data.phoneNumber, data.dateOfBirth);
102
+ RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.submit(data.phoneNumber, data.dateOfBirth, data.params);
102
103
  }
103
104
  };
104
105
  /**
package/dist/Types.d.ts CHANGED
@@ -5,6 +5,7 @@ interface CommonPlaidLinkOptions {
5
5
  export type LinkTokenConfiguration = (CommonPlaidLinkOptions & {
6
6
  token: string;
7
7
  noLoadingState?: boolean;
8
+ onLoad?: () => void;
8
9
  });
9
10
  export declare enum LinkLogLevel {
10
11
  DEBUG = "debug",
@@ -547,5 +548,6 @@ export type FinanceKitError = InvalidTokenError | PermissionError | LinkApiError
547
548
  export interface SubmissionData {
548
549
  phoneNumber?: string;
549
550
  dateOfBirth?: string;
551
+ params?: Record<string, string>;
550
552
  }
551
553
  export {};
@@ -3,11 +3,11 @@ import { Double } from 'react-native/Libraries/Types/CodegenTypes';
3
3
  import { UnsafeObject } from './fabricUtils';
4
4
  import { LinkSuccess, LinkExit } from '../Types';
5
5
  export interface Spec extends TurboModule {
6
- createPlaidLink(token: string, noLoadingState: boolean, logLevel: string): void;
6
+ createPlaidLink(token: string, noLoadingState: boolean, logLevel: string, onLoad: () => void): void;
7
7
  open(onSuccess: (result: UnsafeObject<LinkSuccess>) => void, onExit: (result: UnsafeObject<LinkExit>) => void): void;
8
8
  destroy(): Promise<void>;
9
9
  startLinkActivityForResult(token: string, noLoadingState: boolean, logLevel: string, onSuccessCallback: (result: UnsafeObject<LinkSuccess>) => void, onExitCallback: (result: UnsafeObject<LinkExit>) => void): void;
10
- submit(phoneNumber: string | undefined, dateOfBirth: string | undefined): void;
10
+ submit(phoneNumber: string | undefined, dateOfBirth: string | undefined, params: UnsafeObject<Record<string, string>> | undefined): void;
11
11
  addListener(eventName: string): void;
12
12
  removeListeners(count: Double): void;
13
13
  }
@@ -3,10 +3,10 @@ import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
3
3
  import { UnsafeObject } from './fabricUtils';
4
4
  import { LinkSuccess, LinkExit, LinkError, FinanceKitError } from '../Types';
5
5
  export interface Spec extends TurboModule {
6
- createPlaidLink(token: string, noLoadingState: boolean): void;
6
+ createPlaidLink(token: string, noLoadingState: boolean, onLoad: () => void): void;
7
7
  open(fullScreen: boolean, onSuccess: (result: UnsafeObject<LinkSuccess>) => void, onExit: (error: UnsafeObject<LinkError>, result: UnsafeObject<LinkExit>) => void): void;
8
8
  dismiss(): void;
9
- submit(phoneNumber: string | undefined, dateOfBirth: string | undefined): void;
9
+ submit(phoneNumber: string | undefined, dateOfBirth: string | undefined, params: UnsafeObject<Record<string, string>> | undefined): void;
10
10
  addListener(eventName: string): void;
11
11
  removeListeners(count: Int32): void;
12
12
  syncFinanceKit(token: string, requestAuthorizationIfNeeded: boolean, simulatedBehavior: boolean, onSuccess: (success: boolean) => void, onError: (error: UnsafeObject<FinanceKitError>) => void): void;
@@ -5,6 +5,7 @@ interface CommonPlaidLinkOptions {
5
5
  export type LinkTokenConfiguration = (CommonPlaidLinkOptions & {
6
6
  token: string;
7
7
  noLoadingState?: boolean;
8
+ onLoad?: () => void;
8
9
  });
9
10
  export declare enum LinkLogLevel {
10
11
  DEBUG = "debug",
package/ios/RNLinksdk.mm CHANGED
@@ -28,7 +28,7 @@ static NSString* const kRNLinkKitVersionConstant = @"version";
28
28
  RCT_EXPORT_MODULE();
29
29
 
30
30
  + (NSString*)sdkVersion {
31
- return @"12.6.1"; // SDK_VERSION
31
+ return @"12.8.0"; // SDK_VERSION
32
32
  }
33
33
 
34
34
  + (NSString*)objCBridgeVersion {
@@ -67,7 +67,7 @@ RCT_EXPORT_MODULE();
67
67
  self.hasObservers = NO;
68
68
  }
69
69
 
70
- RCT_EXPORT_METHOD(createPlaidLink:(NSString*)token noLoadingState:(BOOL)noLoadingState) {
70
+ RCT_EXPORT_METHOD(createPlaidLink:(NSString*)token noLoadingState:(BOOL)noLoadingState onLoad:(RCTResponseSenderBlock)onLoad) {
71
71
  __weak RNLinksdk *weakSelf = self;
72
72
 
73
73
  void (^onSuccess)(PLKLinkSuccess *) = ^(PLKLinkSuccess *success) {
@@ -119,7 +119,17 @@ RCT_EXPORT_METHOD(createPlaidLink:(NSString*)token noLoadingState:(BOOL)noLoadin
119
119
  config.noLoadingState = noLoadingState;
120
120
 
121
121
  NSError *creationError = nil;
122
- self.linkHandler = [RNPlaidHelper createWithLinkTokenConfiguration:config error:&creationError];
122
+
123
+ void (^onLoadBlock)(void) = ^{
124
+ RNLinksdk *strongSelf = weakSelf;
125
+ if (onLoad) {
126
+ onLoad(@[]);
127
+ }
128
+ // strongSelf intentionally unused; kept for symmetry and potential future use
129
+ (void)strongSelf;
130
+ };
131
+
132
+ self.linkHandler = [RNPlaidHelper createWithLinkTokenConfiguration:config onLoad:onLoadBlock error:&creationError];
123
133
  self.creationError = creationError;
124
134
  }
125
135
 
@@ -205,11 +215,12 @@ RCT_EXPORT_METHOD(syncFinanceKit:(NSString *)token
205
215
  ];
206
216
  }
207
217
 
208
- RCT_EXPORT_METHOD(submit:(NSString * _Nullable)phoneNumber dateOfBirth:(NSString * _Nullable)dateOfBirth) {
218
+ RCT_EXPORT_METHOD(submit:(NSString * _Nullable)phoneNumber dateOfBirth:(NSString * _Nullable)dateOfBirth params:(NSDictionary * _Nullable)params) {
209
219
  if (self.linkHandler) {
210
220
  PLKSubmissionData *submissionData = [[PLKSubmissionData alloc] init];
211
221
  submissionData.phoneNumber = phoneNumber;
212
222
  submissionData.dateOfBirth = dateOfBirth;
223
+ submissionData.params = params;
213
224
  [self.linkHandler submit:submissionData];
214
225
  }
215
226
  }
@@ -538,6 +549,8 @@ RCT_EXPORT_METHOD(submit:(NSString * _Nullable)phoneNumber dateOfBirth:(NSString
538
549
  return @"ISSUE_FOLLOWED";
539
550
  case PLKEventNameValueSelectAccount:
540
551
  return @"SELECT_ACCOUNT";
552
+ case PLKEventNameValueLayerAutoFillNotAvailable:
553
+ return @"LAYER_AUTOFILL_NOT_AVAILABLE";
541
554
  }
542
555
  return @"unknown";
543
556
  }
@@ -3,6 +3,7 @@
3
3
  @interface RNPlaidHelper : NSObject
4
4
 
5
5
  + (id<PLKHandler> _Nullable)createWithLinkTokenConfiguration:(PLKLinkTokenConfiguration * _Nonnull)linkTokenConfiguration
6
+ onLoad:(void (^_Nullable)(void))onLoad
6
7
  error:(NSError * _Nullable * _Nullable)error;
7
8
 
8
9
  + (void)syncFinanceKit:(NSString * _Nonnull)token
@@ -3,9 +3,11 @@
3
3
  @implementation RNPlaidHelper
4
4
 
5
5
  + (id<PLKHandler> _Nullable)createWithLinkTokenConfiguration:(PLKLinkTokenConfiguration * _Nonnull)linkTokenConfiguration
6
+ onLoad:(void (^_Nullable)(void))onLoad
6
7
  error:(NSError * _Nullable * _Nullable)error
7
8
  {
8
- return [PLKPlaid createWithLinkTokenConfiguration:linkTokenConfiguration error:error];
9
+ // Newer LinkKit Objective-C bridge supports an onLoad callback.
10
+ return [PLKPlaid createWithLinkTokenConfiguration:linkTokenConfiguration onLoad:onLoad error:error];
9
11
  }
10
12
 
11
13
  + (void)syncFinanceKit:(NSString * _Nonnull)token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-plaid-link-sdk",
3
- "version": "12.6.1",
3
+ "version": "12.8.0",
4
4
  "description": "React Native Plaid Link SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,5 +36,5 @@ Pod::Spec.new do |s|
36
36
  end
37
37
 
38
38
  s.dependency 'React-Core'
39
- s.dependency 'Plaid', '~> 6.4.2'
39
+ s.dependency 'Plaid', '~> 6.4.3'
40
40
  end
package/src/PlaidLink.tsx CHANGED
@@ -45,9 +45,11 @@ export const create = (props: LinkTokenConfiguration) => {
45
45
  token,
46
46
  noLoadingState,
47
47
  props.logLevel ?? LinkLogLevel.ERROR,
48
+ props.onLoad ?? (() => {}),
48
49
  );
49
50
  } else {
50
- RNLinksdkiOS?.createPlaidLink(token, noLoadingState);
51
+ const onLoad = props.onLoad ?? (() => {});
52
+ RNLinksdkiOS?.createPlaidLink(token, noLoadingState, onLoad);
51
53
  }
52
54
  };
53
55
 
@@ -115,9 +117,9 @@ export const dismissLink = () => {
115
117
 
116
118
  export const submit = (data: SubmissionData): void => {
117
119
  if (Platform.OS === 'android') {
118
- RNLinksdkAndroid?.submit(data.phoneNumber, data.dateOfBirth);
120
+ RNLinksdkAndroid?.submit(data.phoneNumber, data.dateOfBirth, data.params);
119
121
  } else {
120
- RNLinksdkiOS?.submit(data.phoneNumber, data.dateOfBirth);
122
+ RNLinksdkiOS?.submit(data.phoneNumber, data.dateOfBirth, data.params);
121
123
  }
122
124
  };
123
125
 
package/src/Types.ts CHANGED
@@ -12,6 +12,8 @@ export type LinkTokenConfiguration = (CommonPlaidLinkOptions & {
12
12
  // Note: This should be set to `true` when setting the `eu_config.headless` field in /link/token/create requests to `true`.
13
13
  // For reference, see https://plaid.com/docs/api/tokens/#link-token-create-request-eu-config-headless
14
14
  noLoadingState?: boolean;
15
+ // Optional callback invoked when Link finishes loading and is ready.
16
+ onLoad?: () => void;
15
17
  });
16
18
 
17
19
  export enum LinkLogLevel {
@@ -625,5 +627,6 @@ export type FinanceKitError =
625
627
  export interface SubmissionData {
626
628
  phoneNumber?: string;
627
629
  dateOfBirth?: string;
630
+ params?: Record<string, string>;
628
631
  };
629
632
 
@@ -6,7 +6,7 @@ import {UnsafeObject} from './fabricUtils';
6
6
  import {LinkSuccess, LinkExit} from '../Types';
7
7
 
8
8
  export interface Spec extends TurboModule {
9
- createPlaidLink(token: string, noLoadingState: boolean, logLevel: string): void;
9
+ createPlaidLink(token: string, noLoadingState: boolean, logLevel: string, onLoad: () => void): void;
10
10
  open(
11
11
  onSuccess: (result: UnsafeObject<LinkSuccess>) => void,
12
12
  onExit: (result: UnsafeObject<LinkExit>) => void,
@@ -21,7 +21,8 @@ export interface Spec extends TurboModule {
21
21
  ): void;
22
22
  submit(
23
23
  phoneNumber: string | undefined,
24
- dateOfBirth: string | undefined
24
+ dateOfBirth: string | undefined,
25
+ params: UnsafeObject<Record<string, string>> | undefined
25
26
  ): void;
26
27
  // those two are here for event emitter methods
27
28
  addListener(eventName: string): void;
@@ -6,7 +6,7 @@ import {UnsafeObject} from './fabricUtils';
6
6
  import {LinkSuccess, LinkExit, LinkError, FinanceKitError} from '../Types';
7
7
 
8
8
  export interface Spec extends TurboModule {
9
- createPlaidLink(token: string, noLoadingState: boolean): void;
9
+ createPlaidLink(token: string, noLoadingState: boolean, onLoad: () => void): void;
10
10
  open(
11
11
  fullScreen: boolean,
12
12
  onSuccess: (result: UnsafeObject<LinkSuccess>) => void,
@@ -15,7 +15,8 @@ export interface Spec extends TurboModule {
15
15
  dismiss(): void;
16
16
  submit(
17
17
  phoneNumber: string | undefined,
18
- dateOfBirth: string | undefined
18
+ dateOfBirth: string | undefined,
19
+ params: UnsafeObject<Record<string, string>> | undefined
19
20
  ): void;
20
21
  // those two are here for event emitter methods
21
22
  addListener(eventName: string): void;