react-native-plaid-link-sdk 12.8.2 → 13.0.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/.eslintrc.js +5 -0
- package/.gitattributes +3 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +1458 -0
- package/README.md +17 -277
- package/V13_MIGRATION_GUIDE.md +470 -0
- package/android/build.gradle +30 -98
- package/android/src/main/AndroidManifest.xml +1 -8
- package/android/src/main/java/expo/modules/plaidlinksdk/PlaidEmbeddedResultDispatcher.kt +19 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/PlaidResultMappers.kt +217 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt +5 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkModule.kt +183 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkView.kt +69 -0
- package/build/PlaidEmbeddedSearchView.d.ts +12 -0
- package/build/PlaidEmbeddedSearchView.d.ts.map +1 -0
- package/build/PlaidEmbeddedSearchView.js +8 -0
- package/build/PlaidEmbeddedSearchView.js.map +1 -0
- package/{dist/src/Types.d.ts → build/ReactNativePlaidLinkSdk.types.d.ts} +78 -47
- package/build/ReactNativePlaidLinkSdk.types.d.ts.map +1 -0
- package/{dist/build → build}/ReactNativePlaidLinkSdk.types.js +82 -71
- package/build/ReactNativePlaidLinkSdk.types.js.map +1 -0
- package/build/ReactNativePlaidLinkSdkModule.d.ts +16 -0
- package/build/ReactNativePlaidLinkSdkModule.d.ts.map +1 -0
- package/{dist/build → build}/ReactNativePlaidLinkSdkModule.js +1 -1
- package/build/ReactNativePlaidLinkSdkModule.js.map +1 -0
- package/build/index.d.ts +13 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +134 -0
- package/build/index.js.map +1 -0
- package/eslint.config.js +3 -0
- package/expo-module.config.json +9 -0
- package/ios/Frameworks/LinkKit.xcframework/Info.plist +61 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit-Swift.h +327 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +205 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit-Swift.h +650 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.abi.json +52299 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.private.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.abi.json +52299 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.private.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/Info.plist +59 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/_CodeSignature/CodeResources +230 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit-Swift.h +650 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +256 -0
- package/ios/ReactNativePlaidLinkSdk.podspec +31 -0
- package/ios/src/PlaidEmbeddedSearchView.swift +101 -0
- package/ios/src/RNPlaidLinkSdkVersion.swift +19 -0
- package/ios/src/ReactNativePlaidLinkSdkModule.swift +555 -0
- package/jest.config.js +21 -0
- package/jest.setup.js +7 -0
- package/package.json +32 -72
- package/scripts/check-package-entrypoints.js +146 -0
- package/scripts/extract-rn-enums.js +49 -0
- package/src/PlaidEmbeddedSearchView.tsx +35 -0
- package/src/ReactNativePlaidLinkSdk.types.ts +894 -0
- package/src/ReactNativePlaidLinkSdkModule.ts +31 -0
- package/src/index.ts +207 -22
- package/tsconfig.json +9 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradle.properties +0 -31
- package/android/gradlew +0 -174
- package/android/gradlew.bat +0 -89
- package/android/src/main/java/com/plaid/ActivityResultHandler.java +0 -7
- package/android/src/main/java/com/plaid/ActivityResultManager.java +0 -15
- package/android/src/main/java/com/plaid/GlobalFunctions.kt +0 -42
- package/android/src/main/java/com/plaid/PLKEmbeddedView.kt +0 -161
- package/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt +0 -50
- package/android/src/main/java/com/plaid/PlaidModule.kt +0 -291
- package/android/src/main/java/com/plaid/PlaidPackage.java +0 -117
- package/android/src/main/java/com/plaid/gson/PlaidJsonConverter.kt +0 -94
- package/android/src/main/java/com/plaid/gson/RNAccountAdapter.kt +0 -48
- package/android/src/main/java/com/plaid/gson/RNEventMetadataAdapter.kt +0 -49
- package/android/src/main/java/com/plaid/gson/RNLinkInstitutionAdapter.kt +0 -34
- package/android/src/main/res/layout/plk_embedded_view.xml +0 -5
- package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerDelegate.java +0 -35
- package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerInterface.java +0 -18
- package/android/src/paper/java/com/plaid/NativePlaidLinkModuleAndroidSpec.java +0 -64
- package/android/src/paper/java/com/plaid/NativePlaidLinkModuleiOSSpec.java +0 -59
- package/dist/build/EmbeddedLink/EmbeddedLinkView.d.ts +0 -2
- package/dist/build/EmbeddedLink/EmbeddedLinkView.js +0 -56
- package/dist/build/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
- package/dist/build/EmbeddedLink/EmbeddedLinkView.web.js +0 -2
- package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
- package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.js +0 -3
- package/dist/build/PlaidEmbeddedSearchView.d.ts +0 -2
- package/dist/build/PlaidEmbeddedSearchView.js +0 -25
- package/dist/build/PlaidLink.d.ts +0 -7
- package/dist/build/PlaidLink.js +0 -137
- package/dist/build/ReactNativePlaidLinkSdk.types.d.ts +0 -108
- package/dist/build/ReactNativePlaidLinkSdkModule.d.ts +0 -2
- package/dist/build/ReactNativePlaidLinkSdkView.d.ts +0 -2
- package/dist/build/ReactNativePlaidLinkSdkView.js +0 -7
- package/dist/build/Types.d.ts +0 -108
- package/dist/build/Types.js +0 -462
- package/dist/build/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -2
- package/dist/build/fabric/EmbeddedLinkViewNativeComponent.js +0 -3
- package/dist/build/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -2
- package/dist/build/fabric/NativePlaidLinkModuleAndroid.js +0 -5
- package/dist/build/fabric/NativePlaidLinkModuleiOS.d.ts +0 -2
- package/dist/build/fabric/NativePlaidLinkModuleiOS.js +0 -5
- package/dist/build/fabric/fabricUtils.d.ts +0 -1
- package/dist/build/fabric/fabricUtils.js +0 -2
- package/dist/build/index.d.ts +0 -14
- package/dist/build/index.js +0 -154
- package/dist/src/EmbeddedLink/EmbeddedLinkView.d.ts +0 -13
- package/dist/src/EmbeddedLink/EmbeddedLinkView.js +0 -55
- package/dist/src/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
- package/dist/src/EmbeddedLink/EmbeddedLinkView.web.js +0 -1
- package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
- package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.js +0 -2
- package/dist/src/PlaidLink.d.ts +0 -34
- package/dist/src/PlaidLink.js +0 -136
- package/dist/src/Types.js +0 -463
- package/dist/src/__tests__/Types.tests.d.ts +0 -1
- package/dist/src/__tests__/Types.tests.js +0 -14
- package/dist/src/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -15
- package/dist/src/fabric/EmbeddedLinkViewNativeComponent.js +0 -2
- package/dist/src/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -15
- package/dist/src/fabric/NativePlaidLinkModuleAndroid.js +0 -4
- package/dist/src/fabric/NativePlaidLinkModuleiOS.d.ts +0 -15
- package/dist/src/fabric/NativePlaidLinkModuleiOS.js +0 -4
- package/dist/src/fabric/fabricUtils.d.ts +0 -1
- package/dist/src/fabric/fabricUtils.js +0 -1
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -5
- package/ios/PLKEmbeddedView.m +0 -7
- package/ios/PLKEmbeddedView.swift +0 -116
- package/ios/PLKEmbeddedViewComponentView.h +0 -28
- package/ios/PLKEmbeddedViewComponentView.mm +0 -91
- package/ios/PLKEmbeddedViewManager.swift +0 -14
- package/ios/PLKFabricHelpers.h +0 -116
- package/ios/RNLinksdk-Bridging-Header.h +0 -8
- package/ios/RNLinksdk.h +0 -19
- package/ios/RNLinksdk.mm +0 -732
- package/ios/RNPlaidHelper.h +0 -15
- package/ios/RNPlaidHelper.m +0 -33
- package/ios/react_native_plaid_link_sdk.h +0 -2
- package/react-native-plaid-link-sdk.podspec +0 -40
- package/src/EmbeddedLink/EmbeddedLinkView.tsx +0 -95
- package/src/EmbeddedLink/EmbeddedLinkView.web.tsx +0 -5
- package/src/EmbeddedLink/NativeEmbeddedLinkView.tsx +0 -3
- package/src/PlaidLink.tsx +0 -167
- package/src/Types.ts +0 -634
- package/src/__tests__/Types.tests.ts +0 -15
- package/src/fabric/EmbeddedLinkViewNativeComponent.ts +0 -24
- package/src/fabric/NativePlaidLinkModuleAndroid.ts +0 -32
- package/src/fabric/NativePlaidLinkModuleiOS.ts +0 -33
- 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
|
+
```
|
package/android/build.gradle
CHANGED
|
@@ -1,111 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
42
|
-
|
|
21
|
+
kotlin {
|
|
22
|
+
compilerOptions {
|
|
23
|
+
freeCompilerArgs.add("-Xskip-metadata-version-check")
|
|
24
|
+
}
|
|
43
25
|
}
|
|
44
26
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
77
|
-
|
|
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
|
}
|
|
@@ -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
|
+
}
|