react-native-plaid-link-sdk 12.8.3 → 13.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.
Files changed (159) hide show
  1. package/CHANGELOG.md +1470 -0
  2. package/README.md +217 -239
  3. package/V13_MIGRATION_GUIDE.md +470 -0
  4. package/android/build.gradle +30 -98
  5. package/android/src/main/AndroidManifest.xml +1 -8
  6. package/android/src/main/java/expo/modules/plaidlinksdk/PlaidEmbeddedResultDispatcher.kt +19 -0
  7. package/android/src/main/java/expo/modules/plaidlinksdk/PlaidResultMappers.kt +217 -0
  8. package/android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt +5 -0
  9. package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkModule.kt +183 -0
  10. package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkView.kt +69 -0
  11. package/build/PlaidEmbeddedSearchView.d.ts +12 -0
  12. package/build/PlaidEmbeddedSearchView.d.ts.map +1 -0
  13. package/build/PlaidEmbeddedSearchView.js +8 -0
  14. package/build/PlaidEmbeddedSearchView.js.map +1 -0
  15. package/{dist/src/Types.d.ts → build/ReactNativePlaidLinkSdk.types.d.ts} +78 -47
  16. package/build/ReactNativePlaidLinkSdk.types.d.ts.map +1 -0
  17. package/{dist/build → build}/ReactNativePlaidLinkSdk.types.js +82 -71
  18. package/build/ReactNativePlaidLinkSdk.types.js.map +1 -0
  19. package/build/ReactNativePlaidLinkSdkModule.d.ts +16 -0
  20. package/build/ReactNativePlaidLinkSdkModule.d.ts.map +1 -0
  21. package/{dist/build → build}/ReactNativePlaidLinkSdkModule.js +1 -1
  22. package/build/ReactNativePlaidLinkSdkModule.js.map +1 -0
  23. package/build/index.d.ts +13 -0
  24. package/build/index.d.ts.map +1 -0
  25. package/build/index.js +82 -0
  26. package/build/index.js.map +1 -0
  27. package/expo-module.config.json +9 -0
  28. package/ios/Frameworks/LinkKit.xcframework/Info.plist +44 -0
  29. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit-Swift.h +327 -0
  30. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit.h +22 -0
  31. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
  32. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
  33. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +53695 -0
  34. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +759 -0
  35. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  36. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +759 -0
  37. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  38. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/module.modulemap +11 -0
  39. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
  40. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +201 -0
  41. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit-Swift.h +650 -0
  42. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit.h +22 -0
  43. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
  44. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
  45. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +53695 -0
  46. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +759 -0
  47. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  48. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +759 -0
  49. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
  50. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +53695 -0
  51. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +759 -0
  52. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  53. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +759 -0
  54. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
  55. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/module.modulemap +11 -0
  56. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
  57. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +256 -0
  58. package/ios/ReactNativePlaidLinkSdk.podspec +29 -0
  59. package/ios/src/PlaidEmbeddedSearchView.swift +101 -0
  60. package/ios/src/RNPlaidLinkSdkVersion.swift +19 -0
  61. package/ios/src/ReactNativePlaidLinkSdkModule.swift +555 -0
  62. package/package.json +65 -73
  63. package/src/PlaidEmbeddedSearchView.tsx +35 -0
  64. package/src/ReactNativePlaidLinkSdk.types.ts +894 -0
  65. package/src/ReactNativePlaidLinkSdkModule.ts +31 -0
  66. package/src/index.ts +166 -22
  67. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  68. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  69. package/android/gradle.properties +0 -31
  70. package/android/gradlew +0 -174
  71. package/android/gradlew.bat +0 -89
  72. package/android/src/main/java/com/plaid/ActivityResultHandler.java +0 -7
  73. package/android/src/main/java/com/plaid/ActivityResultManager.java +0 -15
  74. package/android/src/main/java/com/plaid/GlobalFunctions.kt +0 -42
  75. package/android/src/main/java/com/plaid/PLKEmbeddedView.kt +0 -161
  76. package/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt +0 -50
  77. package/android/src/main/java/com/plaid/PlaidModule.kt +0 -291
  78. package/android/src/main/java/com/plaid/PlaidPackage.java +0 -117
  79. package/android/src/main/java/com/plaid/gson/PlaidJsonConverter.kt +0 -94
  80. package/android/src/main/java/com/plaid/gson/RNAccountAdapter.kt +0 -48
  81. package/android/src/main/java/com/plaid/gson/RNEventMetadataAdapter.kt +0 -49
  82. package/android/src/main/java/com/plaid/gson/RNLinkInstitutionAdapter.kt +0 -34
  83. package/android/src/main/res/layout/plk_embedded_view.xml +0 -5
  84. package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerDelegate.java +0 -35
  85. package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerInterface.java +0 -18
  86. package/android/src/paper/java/com/plaid/NativePlaidLinkModuleAndroidSpec.java +0 -64
  87. package/android/src/paper/java/com/plaid/NativePlaidLinkModuleiOSSpec.java +0 -59
  88. package/dist/build/EmbeddedLink/EmbeddedLinkView.d.ts +0 -2
  89. package/dist/build/EmbeddedLink/EmbeddedLinkView.js +0 -56
  90. package/dist/build/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
  91. package/dist/build/EmbeddedLink/EmbeddedLinkView.web.js +0 -2
  92. package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
  93. package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.js +0 -3
  94. package/dist/build/PlaidEmbeddedSearchView.d.ts +0 -2
  95. package/dist/build/PlaidEmbeddedSearchView.js +0 -25
  96. package/dist/build/PlaidLink.d.ts +0 -7
  97. package/dist/build/PlaidLink.js +0 -137
  98. package/dist/build/ReactNativePlaidLinkSdk.types.d.ts +0 -108
  99. package/dist/build/ReactNativePlaidLinkSdkModule.d.ts +0 -2
  100. package/dist/build/ReactNativePlaidLinkSdkView.d.ts +0 -2
  101. package/dist/build/ReactNativePlaidLinkSdkView.js +0 -7
  102. package/dist/build/Types.d.ts +0 -108
  103. package/dist/build/Types.js +0 -462
  104. package/dist/build/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -2
  105. package/dist/build/fabric/EmbeddedLinkViewNativeComponent.js +0 -3
  106. package/dist/build/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -2
  107. package/dist/build/fabric/NativePlaidLinkModuleAndroid.js +0 -5
  108. package/dist/build/fabric/NativePlaidLinkModuleiOS.d.ts +0 -2
  109. package/dist/build/fabric/NativePlaidLinkModuleiOS.js +0 -5
  110. package/dist/build/fabric/fabricUtils.d.ts +0 -1
  111. package/dist/build/fabric/fabricUtils.js +0 -2
  112. package/dist/build/index.d.ts +0 -14
  113. package/dist/build/index.js +0 -154
  114. package/dist/scripts/check-package-entrypoints.d.ts +0 -1
  115. package/dist/scripts/check-package-entrypoints.js +0 -61
  116. package/dist/src/EmbeddedLink/EmbeddedLinkView.d.ts +0 -13
  117. package/dist/src/EmbeddedLink/EmbeddedLinkView.js +0 -55
  118. package/dist/src/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
  119. package/dist/src/EmbeddedLink/EmbeddedLinkView.web.js +0 -1
  120. package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
  121. package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.js +0 -2
  122. package/dist/src/PlaidLink.d.ts +0 -34
  123. package/dist/src/PlaidLink.js +0 -136
  124. package/dist/src/Types.js +0 -463
  125. package/dist/src/__tests__/Types.tests.d.ts +0 -1
  126. package/dist/src/__tests__/Types.tests.js +0 -14
  127. package/dist/src/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -15
  128. package/dist/src/fabric/EmbeddedLinkViewNativeComponent.js +0 -2
  129. package/dist/src/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -15
  130. package/dist/src/fabric/NativePlaidLinkModuleAndroid.js +0 -4
  131. package/dist/src/fabric/NativePlaidLinkModuleiOS.d.ts +0 -15
  132. package/dist/src/fabric/NativePlaidLinkModuleiOS.js +0 -4
  133. package/dist/src/fabric/fabricUtils.d.ts +0 -1
  134. package/dist/src/fabric/fabricUtils.js +0 -1
  135. package/dist/src/index.d.ts +0 -4
  136. package/dist/src/index.js +0 -5
  137. package/ios/PLKEmbeddedView.m +0 -7
  138. package/ios/PLKEmbeddedView.swift +0 -116
  139. package/ios/PLKEmbeddedViewComponentView.h +0 -28
  140. package/ios/PLKEmbeddedViewComponentView.mm +0 -91
  141. package/ios/PLKEmbeddedViewManager.swift +0 -14
  142. package/ios/PLKFabricHelpers.h +0 -116
  143. package/ios/RNLinksdk-Bridging-Header.h +0 -8
  144. package/ios/RNLinksdk.h +0 -19
  145. package/ios/RNLinksdk.mm +0 -732
  146. package/ios/RNPlaidHelper.h +0 -15
  147. package/ios/RNPlaidHelper.m +0 -33
  148. package/ios/react_native_plaid_link_sdk.h +0 -2
  149. package/react-native-plaid-link-sdk.podspec +0 -40
  150. package/src/EmbeddedLink/EmbeddedLinkView.tsx +0 -95
  151. package/src/EmbeddedLink/EmbeddedLinkView.web.tsx +0 -5
  152. package/src/EmbeddedLink/NativeEmbeddedLinkView.tsx +0 -3
  153. package/src/PlaidLink.tsx +0 -167
  154. package/src/Types.ts +0 -634
  155. package/src/__tests__/Types.tests.ts +0 -15
  156. package/src/fabric/EmbeddedLinkViewNativeComponent.ts +0 -24
  157. package/src/fabric/NativePlaidLinkModuleAndroid.ts +0 -32
  158. package/src/fabric/NativePlaidLinkModuleiOS.ts +0 -33
  159. package/src/fabric/fabricUtils.ts +0 -2
@@ -0,0 +1,470 @@
1
+ # React Native Plaid Link SDK v13 Migration Guide
2
+
3
+ This guide covers the breaking changes introduced in `react-native-plaid-link-sdk`
4
+ v13 and shows how to migrate from v11 or v12 integrations.
5
+
6
+ ## Quick Links
7
+
8
+ - [Why Upgrade](#why-upgrade)
9
+ - [Overview](#overview)
10
+ - [Installation and Tooling](#installation-and-tooling)
11
+ - [Standard Link Migration](#standard-link-migration)
12
+ - [Event and Callback Migration](#event-and-callback-migration)
13
+ - [Layer Migration](#layer-migration)
14
+ - [Headless Link Migration](#headless-link-migration)
15
+ - [Embedded Search Migration](#embedded-search-migration)
16
+ - [FinanceKit Migration](#financekit-migration)
17
+ - [Other Breaking Changes](#other-breaking-changes)
18
+
19
+ ## Why Upgrade
20
+
21
+ v13 rebuilds the React Native SDK on Expo Modules and updates the native Link
22
+ integrations. This gives the SDK a single module implementation for Expo and
23
+ bare React Native apps, adds session-based APIs, and brings Android Embedded
24
+ Search support into the public React Native API.
25
+
26
+ ## Overview
27
+
28
+ v13 changes the JavaScript API from global `create`, `open`, `submit`, and event
29
+ emitter helpers to explicit session objects:
30
+
31
+ | v11/v12 API | v13 replacement |
32
+ | --- | --- |
33
+ | `PlaidLink` component | Create your own button and call `createPlaidLinkSession` |
34
+ | `openLink(...)` | `const session = await createPlaidLinkSession(...); await session.open()` |
35
+ | `create(...)` then `open(...)` | `const session = await createPlaidLinkSession(...); await session.open()` |
36
+ | `usePlaidEmitter(...)` | Pass `onEvent` to the session creation function |
37
+ | `submit(...)` | `session.submit(...)` from a `PlaidLayerSession` |
38
+ | `EmbeddedLinkView` | `PlaidEmbeddedSearchView` |
39
+ | callback-style `syncFinanceKit(...)` | promise-returning `syncFinanceKit({ ... })` |
40
+
41
+ The public import path is unchanged:
42
+
43
+ ```ts
44
+ import { createPlaidLinkSession } from "react-native-plaid-link-sdk";
45
+ ```
46
+
47
+ ## Installation and Tooling
48
+
49
+ v13 is an Expo Module package. Bare React Native apps must have Expo Modules
50
+ installed and configured before installing this SDK.
51
+
52
+ ```sh
53
+ npm install react-native-plaid-link-sdk expo
54
+ npx pod-install
55
+ ```
56
+
57
+ If your app is already an Expo app or already has Expo Modules installed, install
58
+ or upgrade only this package:
59
+
60
+ ```sh
61
+ npm install react-native-plaid-link-sdk@^13
62
+ npx pod-install
63
+ ```
64
+
65
+ v13 publishes JavaScript and TypeScript declarations from `build/index.js` and
66
+ `build/index.d.ts`. Apps should continue importing from
67
+ `react-native-plaid-link-sdk`; do not import from `build/`, `src/`, `ios/`, or
68
+ `android/` directly.
69
+
70
+ ## Standard Link Migration
71
+
72
+ ### v11 `openLink` or `PlaidLink`
73
+
74
+ Before v13, older v11 integrations could open Link with `openLink` or the
75
+ deprecated `PlaidLink` component.
76
+
77
+ Before:
78
+
79
+ ```ts
80
+ import {
81
+ LinkIOSPresentationStyle,
82
+ LinkLogLevel,
83
+ openLink,
84
+ } from "react-native-plaid-link-sdk";
85
+
86
+ openLink({
87
+ tokenConfig: {
88
+ token: "#GENERATED_LINK_TOKEN#",
89
+ logLevel: LinkLogLevel.ERROR,
90
+ noLoadingState: false,
91
+ },
92
+ onSuccess: (success) => {
93
+ console.log("Success", success);
94
+ },
95
+ onExit: (exit) => {
96
+ console.log("Exit", exit);
97
+ },
98
+ iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
99
+ });
100
+ ```
101
+
102
+ After:
103
+
104
+ ```ts
105
+ import { createPlaidLinkSession } from "react-native-plaid-link-sdk";
106
+
107
+ const session = await createPlaidLinkSession({
108
+ token: "#GENERATED_LINK_TOKEN#",
109
+ onSuccess: (success) => {
110
+ console.log("Success", success);
111
+ },
112
+ onExit: (exit) => {
113
+ console.log("Exit", exit);
114
+ },
115
+ onEvent: (event) => {
116
+ console.log("Event", event);
117
+ },
118
+ });
119
+
120
+ await session.open(false);
121
+ ```
122
+
123
+ ### v12 `create` and `open`
124
+
125
+ v12 integrations usually preloaded Link with `create(...)` and opened it later
126
+ with `open(...)`.
127
+
128
+ Before:
129
+
130
+ ```ts
131
+ import {
132
+ LinkIOSPresentationStyle,
133
+ LinkLogLevel,
134
+ create,
135
+ open,
136
+ } from "react-native-plaid-link-sdk";
137
+
138
+ create({
139
+ token: "#GENERATED_LINK_TOKEN#",
140
+ logLevel: LinkLogLevel.ERROR,
141
+ noLoadingState: false,
142
+ onLoad: () => {
143
+ console.log("Link loaded");
144
+ },
145
+ });
146
+
147
+ open({
148
+ onSuccess: (success) => {
149
+ console.log("Success", success);
150
+ },
151
+ onExit: (exit) => {
152
+ console.log("Exit", exit);
153
+ },
154
+ iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
155
+ });
156
+ ```
157
+
158
+ After:
159
+
160
+ ```ts
161
+ import { createPlaidLinkSession } from "react-native-plaid-link-sdk";
162
+
163
+ const session = await createPlaidLinkSession({
164
+ token: "#GENERATED_LINK_TOKEN#",
165
+ onSuccess: (success) => {
166
+ console.log("Success", success);
167
+ },
168
+ onExit: (exit) => {
169
+ console.log("Exit", exit);
170
+ },
171
+ onEvent: (event) => {
172
+ console.log("Event", event);
173
+ },
174
+ onLoad: () => {
175
+ console.log("Link loaded");
176
+ },
177
+ });
178
+
179
+ await session.open(false);
180
+ ```
181
+
182
+ `session.open(false)` presents Link using the default presentation. Pass `true`
183
+ to request full-screen presentation.
184
+
185
+ ## Event and Callback Migration
186
+
187
+ `usePlaidEmitter` has been removed. In v13, each session creation function takes
188
+ its own callbacks. This keeps callback ownership tied to the active Link session.
189
+
190
+ Before:
191
+
192
+ ```ts
193
+ import { usePlaidEmitter } from "react-native-plaid-link-sdk";
194
+
195
+ usePlaidEmitter((event) => {
196
+ console.log("Event", event);
197
+ });
198
+ ```
199
+
200
+ After:
201
+
202
+ ```ts
203
+ const session = await createPlaidLinkSession({
204
+ token: "#GENERATED_LINK_TOKEN#",
205
+ onSuccess,
206
+ onExit,
207
+ onEvent: (event) => {
208
+ console.log("Event", event);
209
+ },
210
+ });
211
+ ```
212
+
213
+ The native module uses namespaced internal event names:
214
+
215
+ - `PlaidLink.onSuccess`
216
+ - `PlaidLink.onExit`
217
+ - `PlaidLink.onEvent`
218
+
219
+ These names are implementation details. App code should use the callback
220
+ properties passed to `createPlaidLinkSession`, `createPlaidLayerSession`,
221
+ `createPlaidHeadlessSession`, or `PlaidEmbeddedSearchView`.
222
+
223
+ ### Callback payload changes
224
+
225
+ `metadataJson` is the canonical metadata JSON field in v13 callback payloads:
226
+
227
+ ```ts
228
+ onEvent: (event) => {
229
+ console.log(event.metadata.metadataJson);
230
+ };
231
+ ```
232
+
233
+ If your v11 or v12 TypeScript code references `metadata_json`, update it to
234
+ `metadataJson`. This aligns `LinkEventMetadata` with the rest of the callback
235
+ payload keys, such as `eventName`, `linkSessionId`, `requestId`, and `viewName`.
236
+
237
+ `errorDisplayMessage` has also been removed from `LinkError`. Use
238
+ `displayMessage` instead:
239
+
240
+ ```ts
241
+ onExit: (exit) => {
242
+ console.log(exit.error?.displayMessage);
243
+ };
244
+ ```
245
+
246
+ ## Layer Migration
247
+
248
+ Layer now uses a dedicated session object.
249
+
250
+ Before:
251
+
252
+ ```ts
253
+ import { create, open, submit } from "react-native-plaid-link-sdk";
254
+
255
+ create({
256
+ token: "#GENERATED_LINK_TOKEN#",
257
+ noLoadingState: true,
258
+ });
259
+
260
+ submit({
261
+ phoneNumber: "415-555-0017",
262
+ dateOfBirth: "1975-01-18",
263
+ });
264
+
265
+ open({
266
+ onSuccess: (success) => {
267
+ console.log("Success", success);
268
+ },
269
+ onExit: (exit) => {
270
+ console.log("Exit", exit);
271
+ },
272
+ });
273
+ ```
274
+
275
+ After:
276
+
277
+ ```ts
278
+ import {
279
+ LinkEventName,
280
+ PlaidLayerSession,
281
+ createPlaidLayerSession,
282
+ } from "react-native-plaid-link-sdk";
283
+
284
+ let session: PlaidLayerSession;
285
+
286
+ session = await createPlaidLayerSession({
287
+ token: "#GENERATED_LINK_TOKEN#",
288
+ onSuccess: (success) => {
289
+ console.log("Success", success);
290
+ },
291
+ onExit: (exit) => {
292
+ console.log("Exit", exit);
293
+ },
294
+ onEvent: async (event) => {
295
+ if (event.eventName === LinkEventName.LAYER_READY) {
296
+ await session.open();
297
+ }
298
+ },
299
+ });
300
+
301
+ await session.submit({
302
+ phoneNumber: "415-555-0017",
303
+ dateOfBirth: "1975-01-18",
304
+ });
305
+ ```
306
+
307
+ If your Layer flow only requires a phone number, omit `dateOfBirth`:
308
+
309
+ ```ts
310
+ await session.submit({
311
+ phoneNumber: "415-555-0015",
312
+ });
313
+ ```
314
+
315
+ ## Headless Link Migration
316
+
317
+ Headless Link is new in v13. Create a headless session, then call `start()`.
318
+
319
+ ```ts
320
+ import { createPlaidHeadlessSession } from "react-native-plaid-link-sdk";
321
+
322
+ const session = await createPlaidHeadlessSession({
323
+ token: "#GENERATED_LINK_TOKEN#",
324
+ onSuccess: (success) => {
325
+ console.log("Success", success);
326
+ },
327
+ onExit: (exit) => {
328
+ console.log("Exit", exit);
329
+ },
330
+ onEvent: (event) => {
331
+ console.log("Event", event);
332
+ },
333
+ onLoad: () => {
334
+ console.log("Headless session loaded");
335
+ },
336
+ });
337
+
338
+ await session.start();
339
+ ```
340
+
341
+ ## Embedded Search Migration
342
+
343
+ v11 and v12 exported `EmbeddedLinkView`. v13 exports
344
+ `PlaidEmbeddedSearchView` instead. Android Embedded Search is supported in v13.
345
+
346
+ Before:
347
+
348
+ ```tsx
349
+ import { EmbeddedLinkView } from "react-native-plaid-link-sdk";
350
+
351
+ <EmbeddedLinkView
352
+ token="#GENERATED_LINK_TOKEN#"
353
+ onSuccess={(success) => {
354
+ console.log("Success", success);
355
+ }}
356
+ onExit={(exit) => {
357
+ console.log("Exit", exit);
358
+ }}
359
+ />;
360
+ ```
361
+
362
+ After:
363
+
364
+ ```tsx
365
+ import { PlaidEmbeddedSearchView } from "react-native-plaid-link-sdk";
366
+
367
+ <PlaidEmbeddedSearchView
368
+ token="#GENERATED_LINK_TOKEN#"
369
+ style={{ height: 500 }}
370
+ onLoad={() => {
371
+ console.log("Embedded Search loaded");
372
+ }}
373
+ onSuccess={(success) => {
374
+ console.log("Success", success);
375
+ }}
376
+ onExit={(exit) => {
377
+ console.log("Exit", exit);
378
+ }}
379
+ onEvent={(event) => {
380
+ console.log("Event", event);
381
+ }}
382
+ />;
383
+ ```
384
+
385
+ ## FinanceKit Migration
386
+
387
+ FinanceKit remains iOS-only. In v12, `syncFinanceKit` accepted positional
388
+ arguments and reported completion through a callback. In v13, it accepts a
389
+ configuration object and returns a promise.
390
+
391
+ Before:
392
+
393
+ ```ts
394
+ import { syncFinanceKit } from "react-native-plaid-link-sdk";
395
+
396
+ syncFinanceKit(
397
+ "#GENERATED_LINK_TOKEN#",
398
+ true,
399
+ false,
400
+ (error) => {
401
+ if (error) {
402
+ console.log("FinanceKit error", error);
403
+ return;
404
+ }
405
+
406
+ console.log("FinanceKit sync complete");
407
+ }
408
+ );
409
+ ```
410
+
411
+ After:
412
+
413
+ ```ts
414
+ import {
415
+ FinanceKitSyncBehavior,
416
+ syncFinanceKit,
417
+ } from "react-native-plaid-link-sdk";
418
+
419
+ try {
420
+ await syncFinanceKit({
421
+ token: "#GENERATED_LINK_TOKEN#",
422
+ requestAuthorizationIfNeeded: true,
423
+ syncBehavior: FinanceKitSyncBehavior.LIVE,
424
+ });
425
+
426
+ console.log("FinanceKit sync complete");
427
+ } catch (error) {
428
+ console.log("FinanceKit error", error);
429
+ }
430
+ ```
431
+
432
+ Calling `syncFinanceKit` on Android rejects with an error because FinanceKit is
433
+ only available on iOS.
434
+
435
+ ## Other Breaking Changes
436
+
437
+ ### `LinkAccountSubtypeInvestment.SIIP` renamed to `SIPP`
438
+
439
+ The misspelled investment account subtype constant
440
+ `LinkAccountSubtypeInvestment.SIIP` has been removed and replaced with the
441
+ correctly spelled `LinkAccountSubtypeInvestment.SIPP` (Self-Invested Personal
442
+ Pension).
443
+
444
+ The underlying runtime value is unchanged (`"sipp"`), so this is a compile-time
445
+ rename only. There is no behavior change for accounts that were already filtered
446
+ correctly.
447
+
448
+ Before:
449
+
450
+ ```ts
451
+ import { LinkAccountSubtypeInvestment } from "react-native-plaid-link-sdk";
452
+
453
+ const subtypes = [LinkAccountSubtypeInvestment.SIIP];
454
+ ```
455
+
456
+ After:
457
+
458
+ ```ts
459
+ import { LinkAccountSubtypeInvestment } from "react-native-plaid-link-sdk";
460
+
461
+ const subtypes = [LinkAccountSubtypeInvestment.SIPP];
462
+ ```
463
+
464
+ Action required: replace any usage of `LinkAccountSubtypeInvestment.SIIP` with
465
+ `LinkAccountSubtypeInvestment.SIPP`. TypeScript will surface the removed member
466
+ as a compile error:
467
+
468
+ ```text
469
+ Property 'SIIP' does not exist on type 'typeof LinkAccountSubtypeInvestment'. Did you mean 'SIPP'?
470
+ ```
@@ -1,111 +1,43 @@
1
- allprojects {
2
- repositories {
3
- mavenLocal()
4
- mavenCentral()
5
- maven {
6
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
7
- url "$rootDir/../node_modules/react-native/android"
8
- }
9
- google()
10
- }
1
+ plugins {
2
+ id 'com.android.library'
3
+ id 'expo-module-gradle-plugin'
11
4
  }
12
5
 
6
+ group = 'expo.modules.plaidlinksdk'
7
+ version = '0.1.0'
13
8
 
14
- buildscript {
15
- ext {
16
- kotlin_version = '1.8.22'
17
- }
18
- ext.safeExtGet = {prop, fallback ->
19
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
20
- }
21
- repositories {
22
- google()
23
- mavenCentral()
24
- }
25
-
26
- dependencies {
27
- classpath 'com.android.tools.build:gradle:8.1.1'
28
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
29
- classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
30
- }
9
+ android {
10
+ namespace "expo.modules.plaidlinksdk"
11
+ defaultConfig {
12
+ versionCode 1
13
+ versionName "0.1.0"
14
+ }
15
+ lintOptions {
16
+ abortOnError false
17
+ }
31
18
  }
32
19
 
33
- def isNewArchitectureEnabled() {
34
- // To opt-in for the New Architecture, you can either:
35
- // - Set `newArchEnabled` to true inside the `gradle.properties` file
36
- // - Invoke gradle with `-newArchEnabled=true`
37
- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
38
- return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
39
- }
40
20
 
41
- if (isNewArchitectureEnabled()) {
42
- apply plugin: "com.facebook.react"
21
+ kotlin {
22
+ compilerOptions {
23
+ freeCompilerArgs.add("-Xskip-metadata-version-check")
24
+ }
43
25
  }
44
26
 
45
- apply plugin: 'com.android.library'
46
- apply plugin: "kotlin-android"
47
-
48
- android {
49
-
50
- // Used to override the NDK path/version on internal CI or by allowing
51
- // users to customize the NDK path/version from their root project (e.g. for M1 support)
52
- if (rootProject.hasProperty("ndkPath")) {
53
- ndkPath rootProject.ext.ndkPath
54
- }
55
- if (rootProject.hasProperty("ndkVersion")) {
56
- ndkVersion rootProject.ext.ndkVersion
57
- }
58
-
59
- def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
60
- if (agpVersion >= 7) {
61
- namespace 'com.plaid'
62
- }
63
- compileSdkVersion 34
27
+ dependencies {
28
+ implementation "com.plaid.link:sdk-core:6.0.0"
29
+ testImplementation "junit:junit:4.13.2"
30
+ }
64
31
 
65
- defaultConfig {
66
- minSdkVersion rootProject.ext.has("minSdkVersion") ? rootProject.ext.minSdkVersion : 21
67
- targetSdkVersion 34
68
- versionCode 1
69
- versionName "0.0.1"
70
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
71
- }
72
- lintOptions {
73
- abortOnError false
32
+ gradle.projectsEvaluated {
33
+ rootProject.allprojects { project ->
34
+ project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { task ->
35
+ task.compilerOptions.freeCompilerArgs.add("-Xskip-metadata-version-check")
74
36
  }
75
-
76
- if (agpVersion < 8) {
77
- compileOptions {
78
- sourceCompatibility JavaVersion.VERSION_1_8
79
- targetCompatibility JavaVersion.VERSION_1_8
37
+ if (project.name.startsWith("expo")) {
38
+ project.tasks.withType(org.gradle.api.tasks.testing.Test).configureEach { task ->
39
+ task.failOnNoDiscoveredTests = false
80
40
  }
81
41
  }
82
-
83
- sourceSets.main {
84
- java {
85
- if (!isNewArchitectureEnabled()) {
86
- srcDirs += 'src/paper/java'
87
- }
88
- }
89
- }
90
-
91
- buildTypes {
92
- release {
93
- debuggable = false
94
- }
95
- debug {
96
- debuggable = true
97
- }
98
- }
99
- }
100
-
101
- repositories {
102
- google()
103
- mavenCentral()
104
- maven { url "$rootDir/../node_modules/react-native/android" }
105
- }
106
-
107
- dependencies {
108
- implementation "com.facebook.react:react-native:+"
109
- implementation "com.plaid.link:sdk-core:5.5.2"
110
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
42
+ }
111
43
  }
@@ -1,9 +1,2 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
-
3
- <application>
4
- <meta-data
5
- android:name="com.plaid.link.react_native"
6
- android:value="12.8.3" />
7
- </application>
8
-
1
+ <manifest>
9
2
  </manifest>
@@ -0,0 +1,19 @@
1
+ package expo.modules.plaidlinksdk
2
+
3
+ import com.plaid.link.result.LinkResult
4
+
5
+ internal object PlaidEmbeddedResultDispatcher {
6
+ private val handlers = mutableSetOf<(LinkResult) -> Unit>()
7
+
8
+ fun register(handler: (LinkResult) -> Unit) {
9
+ handlers.add(handler)
10
+ }
11
+
12
+ fun unregister(handler: (LinkResult) -> Unit) {
13
+ handlers.remove(handler)
14
+ }
15
+
16
+ fun dispatch(result: LinkResult) {
17
+ handlers.toList().forEach { it(result) }
18
+ }
19
+ }