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
package/README.md CHANGED
@@ -1,300 +1,278 @@
1
1
  # Plaid React Native SDK
2
2
 
3
- ![version](https://img.shields.io/npm/v/react-native-plaid-link-sdk)
4
- [![License](https://img.shields.io/github/license/plaid/react-native-plaid-link-sdk)](https://github.com/plaid/react-native-plaid-link-sdk/blob/master/LICENSE)
3
+ React Native SDK for Plaid Link, built on Expo Modules for the v13 native
4
+ architecture. The SDK supports Expo apps and bare React Native apps through the
5
+ same session-based JavaScript API.
5
6
 
6
- The Plaid React Native SDK provides the client-side component that your users will interact with in order to link their accounts to Plaid and allow you access to their accounts via the Plaid API.
7
+ ## API documentation
7
8
 
8
- For more information about Plaid Link check out our
9
- [introduction documentation](https://plaid.com/docs/link/#introduction-to-link).
9
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/react-native-plaid-link-sdk/)
10
+ - [Documentation for the main branch](https://docs.expo.dev/versions/unversioned/sdk/react-native-plaid-link-sdk/)
11
+ - [Plaid Link documentation](https://plaid.com/docs/link/)
10
12
 
11
- Plaid currently supports two versions of the Plaid React Native SDK v10.x and v11.x. You can find v10 on the [master-v10](https://github.com/plaid/react-native-plaid-link-sdk/tree/master-v10) branch.
13
+ ## Requirements
12
14
 
13
- ## Features
15
+ ### React Native and Expo
14
16
 
15
- The SDK provides:
17
+ - React Native 0.76 or newer
18
+ - Expo 52 or newer, or bare React Native with Expo Modules installed
19
+ - A development build, custom native build, or bare native app
16
20
 
17
- - A PlaidLink functional component.
18
- - A function to open Link.
19
- - A hook to handle [onEvent](https://plaid.com/docs/link/react-native/#onevent) callbacks.
20
- - A function to dismiss link on iOS.
21
+ Expo Go is not supported because Plaid Link includes custom native code. Expo
22
+ apps should use a development build or another app build that includes this
23
+ native module.
21
24
 
22
- ## Getting Started
25
+ ### iOS
23
26
 
24
- Get started with our 📝 [documentation](https://plaid.com/docs/link/react-native/) and the 📱[example project](https://github.com/plaid/react-native-plaid-link-sdk/blob/master/example/README.md), or ↔️ [Tiny Quickstart (React Native)](https://github.com/plaid/tiny-quickstart/tree/main/react_native) which is an end to end example demonstrating a minimal integration with this SDK.
27
+ - iOS 15.1 or newer
28
+ - Xcode 16.1 or newer
29
+ - CocoaPods for installing native dependencies
25
30
 
26
- If you're unfamiliar with React Native we recommend starting with the [environment setup instructions](https://reactnative.dev/docs/environment-setup).
31
+ ### Android
27
32
 
28
- In your React Native project directory:
33
+ - Android Studio 4.0 or newer
34
+ - Kotlin 1.9.25 or newer for Kotlin integrations
35
+ - A package name registered in the Plaid Dashboard for Android OAuth flows
29
36
 
30
- ```sh
31
- npm install --save react-native-plaid-link-sdk
32
- ```
37
+ ## Compatibility
33
38
 
34
- ### iOS Setup
39
+ The SDK supports React Native 0.76 or newer and Expo 52 or newer. Expo support
40
+ requires a development build, custom native build, or bare native app; Expo Go is
41
+ not supported.
35
42
 
36
- Autolinking should install the CocoaPods dependencies for iOS project. If it fails you can run
37
-
38
- ```sh
39
- cd ios && bundle install && bundle exec pod install
40
- ```
43
+ | Lane | React Native | Expo | CI coverage |
44
+ | ----------------- | ------------ | ---- | ----------------------------------------------------------------------------------- |
45
+ | Minimum supported | 0.76 | 52 | Peer install and package export smoke test |
46
+ | Current example | 0.83 | 55 | Peer install and package export smoke test, Android unit tests, iOS simulator build |
47
+ | Latest Expo | 0.85 | 56 | Packed SDK install and iOS prebuild smoke test |
41
48
 
42
- ### Android Setup
49
+ The root package unit tests run against the repository's development
50
+ dependencies, while the example app validates the current native integration on
51
+ both platforms.
43
52
 
44
- - Android 5.0 (API level 21) and above.
45
- - Your `compileSdkVersion` must be `33`.
46
- - Android gradle plugin `4.x` and above.
53
+ ## Migration guides
47
54
 
48
- AutoLinking should handle all of the Android setup.
55
+ - [v13 migration guide](./V13_MIGRATION_GUIDE.md)
49
56
 
50
- Remember to register your Android package name in the [Dashboard](https://dashboard.plaid.com/developers/api). This is required in order to connect to OAuth institutions (which includes most major banks).
57
+ ## Installation
51
58
 
52
- ### React Native Setup
59
+ ### Expo projects
53
60
 
54
- - To initialize `PlaidLink`, you will need to first create a `link_token` at [/link/token/create](https://plaid.com/docs/api/link/#linktokencreate). Check out our [QuickStart guide](https://plaid.com/docs/quickstart/#introduction) for additional API information.
61
+ Install the package in an Expo project, then run the app in a development build
62
+ or another custom native runtime.
55
63
 
56
- #### Version >= 11.6.0
64
+ ```sh
65
+ npm install react-native-plaid-link-sdk
66
+ ```
57
67
 
58
- 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.
68
+ If you are adding the SDK to an existing Expo app, rebuild the native app after
69
+ installation so the Plaid native module is included.
59
70
 
60
- ```typescript
61
- function createLinkTokenConfiguration(
62
- token: string,
63
- noLoadingState: boolean = false,
64
- ): LinkTokenConfiguration {
65
- return {
66
- token: token,
67
- // Hides native activity indicator if true.
68
- noLoadingState: noLoadingState,
69
- };
70
- }
71
+ ### Bare React Native projects
71
72
 
72
- const tokenConfiguration = createLinkTokenConfiguration("#GENERATED_LINK_TOKEN#");
73
- create(tokenConfiguration);
74
- ```
75
-
76
- 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.
77
-
78
- ```typescript
79
- function createLinkOpenProps(): LinkOpenProps {
80
- return {
81
- onSuccess: (success: LinkSuccess) => {
82
- // User was able to successfully link their account.
83
- console.log('Success: ', success);
84
- },
85
- onExit: (linkExit: LinkExit) => {
86
- // User exited Link session. There may or may not be an error depending on what occured.
87
- console.log('Exit: ', linkExit);
88
- dismissLink();
89
- },
90
- // MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
91
- iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
92
- logLevel: LinkLogLevel.ERROR,
93
- };
94
- }
73
+ Bare React Native apps must install and configure the `expo` package before
74
+ using this SDK.
95
75
 
96
- const openProps = createLinkOpenProps();
97
- open(openProps);
76
+ ```sh
77
+ npm install react-native-plaid-link-sdk expo
78
+ npx pod-install
98
79
  ```
99
80
 
100
- #### Version < 11.6.0
101
-
102
- In versions prior to `11.6.0`, you can open a link by calling the `openLink` function.
103
-
104
- ```typescript
105
- // Create PlaidLinkProps from the provided token string.
106
- function makeLinkTokenProps(token: string): PlaidLinkProps {
107
- return {
108
- tokenConfig: {
109
- token: token,
110
- logLevel: LinkLogLevel.ERROR,
111
- // Hides native activity indicator if true.
112
- noLoadingState: false,
113
- },
114
- onSuccess: (success: LinkSuccess) => {
115
- // User was able to successfully link their account.
116
- console.log('Success: ', success);
117
- success.metadata.accounts.forEach(it => console.log('accounts', it));
118
- },
119
- onExit: (linkExit: LinkExit) => {
120
- // User exited Link session. There may or may not be an error depending on what occured.
121
- console.log('Exit: ', linkExit);
122
- dismissLink();
123
- },
124
- // MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
125
- iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
126
- };
127
- }
128
-
129
- const linkTokenProps = makeLinkTokenProps("#GENERATED_LINK_TOKEN#");
130
- openLink(linkTokenProps);
131
- ```
81
+ Follow Expo's guide for
82
+ [installing Expo Modules in an existing React Native app](https://docs.expo.dev/bare/installing-expo-modules/)
83
+ if your bare app does not already use Expo Modules.
132
84
 
133
- #### OAuth requirements
85
+ ## Plaid Dashboard setup
134
86
 
135
- :warning: All integrations must use version 9.0.0 or later of the React Native SDK (requires version 4.1.0 or later of the iOS LinkKit SDK) to maintain support for Chase OAuth on iOS.
87
+ Configure the native app identifiers that your app will use with Link:
136
88
 
137
- ##### Android OAuth Requirements
89
+ - Android package names
90
+ - iOS bundle identifiers
91
+ - OAuth redirect URIs for every environment your app supports
138
92
 
139
- ###### Register your app package name
140
- 1. Log into your [Plaid Dashboard](https://dashboard.plaid.com/developers/api) and navigate to the API page under the Developers tab.
141
- 2. Next to Allowed Android package names click "Configure" then "Add New Android Package Name".
142
- 3. Enter your package name, for example `com.plaid.example`.
143
- 4. Click "Save Changes", you may be prompted to re-enter your password.
93
+ The link token passed to this SDK must be created by your server with the Link
94
+ configuration for the flow you want to launch. Do not create link tokens in the
95
+ mobile app.
144
96
 
145
- ##### iOS OAuth Requirements
97
+ ## Standard Link
146
98
 
147
- For iOS OAuth to work, specific requirements must be met.
148
- 1. Redirect URIs must be [registered](https://plaid.com/docs/link/ios/#register-your-redirect-uri), and set up as [universal links](https://developer.apple.com/documentation/xcode/supporting-associated-domains).
149
- 2. Your native iOS application, must be configured with your associated domain. See your iOS [set up universal links](https://plaid.com/docs/link/ios/#set-up-universal-links) for more information.
99
+ Create a Link session with a link token, then open it from your UI.
150
100
 
101
+ ```ts
102
+ import { createPlaidLinkSession } from "react-native-plaid-link-sdk";
103
+
104
+ const session = await createPlaidLinkSession({
105
+ token: "#GENERATED_LINK_TOKEN#",
106
+ onSuccess: (success) => {
107
+ console.log("Success", success);
108
+ },
109
+ onExit: (exit) => {
110
+ console.log("Exit", exit);
111
+ },
112
+ onEvent: (event) => {
113
+ console.log("Event", event);
114
+ },
115
+ onLoad: () => {
116
+ console.log("Link loaded");
117
+ },
118
+ });
119
+
120
+ await session.open();
121
+ ```
151
122
 
152
- ##### Link Token OAuth Requirements
123
+ Pass `true` to `session.open(true)` to request full-screen presentation on iOS.
124
+ The default presentation is used when this argument is omitted or `false`.
153
125
 
154
- - On iOS you must configure your `link_token` with a [redirect_uri](https://plaid.com/docs/api/link/#link-token-create-request-redirect-uri) to support OAuth. When creating a `link_token` for initializing Link on Android, `android_package_name` must be specified and `redirect_uri` must be left blank.
126
+ ## Layer
155
127
 
156
- - On Android you must configure your `link_token` with an [android_package_name](https://plaid.com/docs/api/link/#link-token-create-request-android-package-name) to support OAuth. When creating a `link_token` for initializing Link on iOS, `android_package_name` must be left blank and `redirect_uri` should be used instead.
128
+ Layer uses a dedicated session object. Submit user data once the Layer session is
129
+ ready, then open Link when the Layer flow emits the ready event.
157
130
 
131
+ ```ts
132
+ import {
133
+ LinkEventName,
134
+ PlaidLayerSession,
135
+ createPlaidLayerSession,
136
+ } from "react-native-plaid-link-sdk";
137
+
138
+ let session: PlaidLayerSession;
139
+
140
+ session = await createPlaidLayerSession({
141
+ token: "#GENERATED_LINK_TOKEN#",
142
+ onSuccess: (success) => {
143
+ console.log("Success", success);
144
+ },
145
+ onExit: (exit) => {
146
+ console.log("Exit", exit);
147
+ },
148
+ onEvent: async (event) => {
149
+ if (event.eventName === LinkEventName.LAYER_READY) {
150
+ await session.open();
151
+ }
152
+ },
153
+ });
154
+
155
+ await session.submit({
156
+ phoneNumber: "415-555-0017",
157
+ dateOfBirth: "1975-01-18",
158
+ });
159
+ ```
158
160
 
159
- #### To receive onEvent callbacks:
161
+ ## Headless Link
160
162
 
161
- 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:
163
+ Headless Link creates a session that starts without presenting the standard Link
164
+ UI.
162
165
 
163
- ```javascript
164
- usePlaidEmitter((event: LinkEvent) => {
165
- console.log(event)
166
- })
166
+ ```ts
167
+ import { createPlaidHeadlessSession } from "react-native-plaid-link-sdk";
168
+
169
+ const session = await createPlaidHeadlessSession({
170
+ token: "#GENERATED_LINK_TOKEN#",
171
+ onSuccess: (success) => {
172
+ console.log("Success", success);
173
+ },
174
+ onExit: (exit) => {
175
+ console.log("Exit", exit);
176
+ },
177
+ onEvent: (event) => {
178
+ console.log("Event", event);
179
+ },
180
+ onLoad: () => {
181
+ console.log("Headless session loaded");
182
+ },
183
+ });
184
+
185
+ await session.start();
167
186
  ```
168
187
 
169
- #### Clearing Previous Session State with `destroy()`
188
+ ## Embedded Search
189
+
190
+ Embedded Search is available on iOS and Android through
191
+ `PlaidEmbeddedSearchView`.
192
+
193
+ ```tsx
194
+ import { PlaidEmbeddedSearchView } from "react-native-plaid-link-sdk";
195
+
196
+ export function EmbeddedSearch() {
197
+ return (
198
+ <PlaidEmbeddedSearchView
199
+ token="#GENERATED_LINK_TOKEN#"
200
+ style={{ height: 500 }}
201
+ onLoad={() => {
202
+ console.log("Embedded Search loaded");
203
+ }}
204
+ onSuccess={(success) => {
205
+ console.log("Success", success);
206
+ }}
207
+ onExit={(exit) => {
208
+ console.log("Exit", exit);
209
+ }}
210
+ onEvent={(event) => {
211
+ console.log("Event", event);
212
+ }}
213
+ />
214
+ );
215
+ }
216
+ ```
170
217
 
171
- The `destroy()` method clears state and resources from a previously opened session.
172
- It's especially useful if you're seeing unexpected behavior when calling `create()` multiple times — for example, if the phone number isn't submitting properly after multiple `create()` calls.
218
+ ## FinanceKit
173
219
 
174
- #### Problem scenario:
175
- ```ts
176
- create(tokenConfiguration1)
177
- create(tokenConfiguration2)
178
- submit(phoneNumber) // <-- might not submit correctly
179
- ```
220
+ FinanceKit is available on iOS only. Calling `syncFinanceKit` on Android rejects
221
+ with an error.
180
222
 
181
- #### Solution:
182
223
  ```ts
183
- create(tokenConfiguration1)
184
- async () => {
185
- try {
186
- await destroy(); // Clear previous session state
187
- create(tokenConfiguration2);
188
- submit(phoneNumber);
189
- } catch (e) {
190
- console.error('Error during flow:', e);
191
- }
224
+ import {
225
+ FinanceKitSyncBehavior,
226
+ syncFinanceKit,
227
+ } from "react-native-plaid-link-sdk";
228
+
229
+ try {
230
+ await syncFinanceKit({
231
+ token: "#GENERATED_LINK_TOKEN#",
232
+ requestAuthorizationIfNeeded: true,
233
+ syncBehavior: FinanceKitSyncBehavior.LIVE,
234
+ });
235
+
236
+ console.log("FinanceKit sync complete");
237
+ } catch (error) {
238
+ console.log("FinanceKit error", error);
192
239
  }
193
240
  ```
194
241
 
195
- By calling destroy() before the second create(), you ensure a clean state, preventing issues like failed phone number submissions.
242
+ ## Troubleshooting
196
243
 
197
- ## Upgrading
244
+ ### Expo Go cannot load the native module
198
245
 
199
- Plaid releases updates to the SDK approximately every few months. For the best user experience, we recommend using the latest version of the SDK.
246
+ Expo Go does not include Plaid Link's native code. Use an Expo development
247
+ build, another custom native runtime, or a bare React Native app.
200
248
 
201
- Major SDK versions are released annually. SDK versions are supported for two years; with each major SDK release, Plaid will stop officially supporting any previous SDK versions that are more than two years old.
249
+ ### iOS build cannot find LinkKit
202
250
 
203
- While these older versions are expected to continue to work without disruption, Plaid will not provide assistance with unsupported SDK versions.
251
+ Run `npx pod-install` after installing or upgrading the package. v13 ships the
252
+ required `LinkKit.xcframework` in the npm package.
204
253
 
205
- ## Migration guides
254
+ ### Android OAuth redirects fail
206
255
 
207
- 11.x->12.x:
208
- - Removed the `PlaidLink` component and `openLink` function, which were deprecated in version 11.6.0. If you are using this method of opening Link, replace it with the new process that uses `create` and then `open`. For sample code, see [Version 11.6](https://github.com/plaid/react-native-plaid-link-sdk?tab=readme-ov-file#version--1160) or the [Plaid React Native Link docs](https://plaid.com/docs/link/react-native).
209
- - Also see [Version compatibility table](#version-compatibility) for required toolchain updates.
210
- 9.x/10.x-> 11.x: See [React Native SDK 11 Migration Guide](https://github.com/plaid/react-native-plaid-link-sdk/blob/master/v11-migration-guide.md)
211
-
212
- If migrating from older versions, see the [docs](https://plaid.com/docs/link/react-native/#migration-guides) for more information.
213
-
214
- ## Version compatibility
215
-
216
- | Plaid SDK Version | Min React Native Version | Android SDK | Android Min Version | Android Compile Version| iOS SDK | iOS Min Version | Status |
217
- |-------------------|--------------------------|-------------|---------------------|------------------------|---------|-----------------|-------------------------------|
218
- | 12.8.3 | * | [5.5.1+] | 21 | 34 | >=6.4.3 | 14.0 | Active, supports Xcode 16.1.0 |
219
- | 12.8.2 | * | [5.5.1+] | 21 | 34 | >=6.4.3 | 14.0 | Active, supports Xcode 16.1.0 |
220
- | 12.8.1 | * | [5.5.2+] | 21 | 34 | >=6.4.3 | 14.0 | Active, supports Xcode 16.1.0 |
221
- | 12.8.0 | * | [5.5.1+] | 21 | 34 | >=6.4.3 | 14.0 | Active, supports Xcode 16.1.0 |
222
- | 12.7.0 | * | [5.5.0+] | 21 | 34 | >=6.4.2 | 14.0 | Active, supports Xcode 16.1.0 |
223
- | 12.6.1 | * | [5.4.0+] | 21 | 34 | >=6.4.2 | 14.0 | Active, supports Xcode 16.1.0 |
224
- | 12.6.0 | * | [5.4.0+] | 21 | 34 | >=6.4.1 | 14.0 | Active, supports Xcode 16.1.0 |
225
- | 12.5.3 | * | [5.3.4+] | 21 | 34 | >=6.4.0 | 14.0 | Active, supports Xcode 16.1.0 |
226
- | 12.5.2 | * | [5.3.3+] | 21 | 34 | >=6.4.0 | 14.0 | Active, supports Xcode 16.1.0 |
227
- | 12.5.1 | * | [5.3.2+] | 21 | 34 | >=6.4.0 | 14.0 | Active, supports Xcode 16.1.0 |
228
- | 12.5.0 | * | [5.3.2+] | 21 | 34 | >=6.4.0 | 14.0 | Active, supports Xcode 16.1.0 |
229
- | 12.4.0 | * | [5.3.0+] | 21 | 34 | >=6.4.0 | 14.0 | Active, supports Xcode 16.1.0 |
230
- | 12.3.2 | * | [5.2.0+] | 21 | 34 | >=6.3.2 | 14.0 | Active, supports Xcode 16.1.0 |
231
- | 12.3.1 | * | [5.2.0+] | 21 | 34 | >=6.3.1 | 14.0 | **Deprecated** |
232
- | 12.3.0 | * | [5.2.0+] | 21 | 34 | >=6.3.0 | 14.0 | Active, supports Xcode 16.1.0 |
233
- | 12.2.1 | * | [5.1.1+] | 21 | 34 | >=6.2.1 | 14.0 | Active, supports Xcode 16.1.0 |
234
- | 12.2.0 | * | [5.1.1+] | 21 | 34 | >=6.2.1 | 14.0 | Active, supports Xcode 16.1.0 |
235
- | 12.1.1 | * | [5.0.0+] | 21 | 34 | >=6.1.0 | 14.0 | Active, supports Xcode 16.1.0 |
236
- | 12.1.0 | * | [5.0.0+] | 21 | 34 | >=6.1.0 | 14.0 | Active, supports Xcode 16.1.0 |
237
- | 12.0.3 | * | [5.0.0+] | 21 | 34 | >=6.0.4 | 14.0 | Active, supports Xcode 16.1.0 |
238
- | 12.0.2 | * | [5.0.0+] | 21 | 34 | >=6.0.2 | 14.0 | Active, supports Xcode 16.1.0 |
239
- | 12.0.1 | * | [5.0.0+] | 21 | 34 | >=6.0.2 | 14.0 | Active, supports Xcode 16.1.0 |
240
- | 12.0.0 | * | [5.0.0+] | 21 | 34 | >=6.0.0 | 14.0 | Active, supports Xcode 16.1.0 |
241
- | 12.0.0-beta.3 | * | [4.4.0+] | 21 | 34 | >=6.0.0 | 14.0 | Active, supports Xcode 15.3.0 |
242
- | 12.0.0-beta.2 | * | [4.4.0+] | 21 | 34 | >=6.0.0 | 14.0 | Active, supports Xcode 15.3.0 |
243
- | 12.0.0-beta.1 | * | [4.4.0+] | 21 | 34 | >=6.0.0 | 14.0 | **Deprecated** |
244
- | 11.13.3 | * | [4.6.1+] | 21 | 34 | >=5.6.1 | 14.0 | Active, supports Xcode 15.0.1 |
245
- | 11.13.2 | * | [4.6.1+] | 21 | 34 | >=5.6.1 | 14.0 | Active, supports Xcode 15.0.1 |
246
- | 11.13.1 | * | [4.6.1+] | 21 | 34 | >=5.6.1 | 14.0 | Active, supports Xcode 15.0.1 |
247
- | 11.13.0 | * | [4.6.1+] | 21 | 34 | >=5.6.1 | 14.0 | Active, supports Xcode 15.0.1 |
248
- | 11.12.1 | * | [4.6.0+] | 21 | 34 | >=5.6.0 | 14.0 | Active, supports Xcode 15.0.1 |
249
- | 11.12.0 | * | [4.6.0+] | 21 | 34 | >=5.6.0 | 14.0 | Active, supports Xcode 15.0.1 |
250
- | 11.11.2 | * | [4.5.1+] | 21 | 34 | >=5.6.0 | 14.0 | Active, supports Xcode 15.0.1 |
251
- | 11.11.1 | * | [4.5.1+] | 21 | 34 | >=5.6.0 | 14.0 | Active, supports Xcode 15.0.1 |
252
- | 11.11.0 | * | [4.5.0+] | 21 | 34 | >=5.6.0 | 14.0 | Active, supports Xcode 15.0.1 |
253
- | 11.10.3 | * | [4.4.2+] | 21 | 34 | >=5.5.1 | 14.0 | Active, supports Xcode 15.0.1 |
254
- | 11.10.2 | * | [4.3.1+] | 21 | 34 | >=5.5.1 | 14.0 | Active, supports Xcode 15.0.1 |
255
- | 11.10.1 | * | [4.3.1+] | 21 | 34 | >=5.5.0 | 14.0 | Active, supports Xcode 15.0.1 |
256
- | 11.10.0 | * | [4.3.1+] | 21 | 34 | >=5.5.0 | 14.0 | Active, supports Xcode 15.0.1 |
257
- | 11.9.0 | * | [4.3.1+] | 21 | 34 | >=5.5.0 | 14.0 | Active, supports Xcode 15.0.1 |
258
- | 11.8.2 | * | [4.3.1+] | 21 | 34 | >=5.4.2 | 14.0 | Active, supports Xcode 15.0.1 |
259
- | 11.8.1 | * | [4.3.1+] | 21 | 34 | >=5.4.2 | 14.0 | Active, supports Xcode 15.0.1 |
260
- | 11.8.0 | * | [4.3.1+] | 21 | 34 | >=5.4.2 | 14.0 | Active, supports Xcode 15.0.1 |
261
- | 11.7.1 | * | [4.3.0+] | 21 | 34 | >=5.4.1 | 14.0 | Active, supports Xcode 15.0.1 |
262
- | 11.7.0 | * | [4.3.0+] | 21 | 34 | >=5.4.0 | 14.0 | Active, supports Xcode 15.0.1 |
263
- | 11.6.0 | * | [4.2.0+] | 21 | 34 | >=5.3.1 | 14.0 | Active, supports Xcode 15.0.1 |
264
- | 11.5.2 | * | [4.1.1+] | 21 | 34 | >=5.2.1 | 14.0 | Active, supports Xcode 15.0.1 |
265
- | 11.5.1 | * | [4.1.1+] | 21 | 34 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
266
- | 11.5.0 | * | [4.1.1+] | 21 | 34 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
267
- | 11.4.0 | * | [4.1.1+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
268
- | 11.3.0 | * | [4.0.0+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
269
- | ~11.2.0~ | * | [4.1.0+] | 21 | 34 | >=5.1.0 | 14.0 | **Deprecated** |
270
- | 11.1.0 | * | [4.0.0+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
271
- | 11.0.3 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
272
- | 11.0.2 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
273
- | 11.0.1 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
274
- | 11.0.0 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
275
- | 10.13.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.2 | 11.0 | Active, supports Xcode 14 |
276
- | 10.12.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
277
- | 10.11.0 | >= 0.66.0 | [3.14.1+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
278
- | ~10.10.0~ | >= 0.66.0 | [3.14.2+] | 21 | 33 | >=4.7.1 | 11.0 | **Deprecated** |
279
- | 10.9.1 | >= 0.66.0 | [3.14.1+] | 21 | 33 | >=4.7.0 | 11.0 | Active, supports Xcode 14 |
280
- | 10.9.0 | >= 0.66.0 | [3.14.1+] | 21 | 33 | >=4.7.0 | 11.0 | Active, supports Xcode 14 |
281
- | 10.8.0 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.7.0 | 11.0 | Active, supports Xcode 14 |
282
- | 10.7.0 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Active, supports Xcode 14 |
283
- | 10.6.4 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Active, supports Xcode 14 |
284
- | 10.6.3 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Active, supports Xcode 14 |
285
- | 10.6.2 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Deprecated, supports Xcode 14 |
286
- | 10.6.0 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Deprecated, supports Xcode 14 |
287
- | 10.5.0 | >= 0.66.0 | [3.13.2+] | 21 | 33 | >=4.5.1 | 11.0 | Deprecated, supports Xcode 14 |
288
- | 10.4.0 | >= 0.66.0 | [3.13.2+] | 21 | 33 | >=4.4.0 | 11.0 | Deprecated, supports Xcode 14 |
289
- | 10.3.0 | >= 0.66.0 | [3.12.1+] | 21 | 33 | >=4.3.0 | 11.0 | Deprecated, supports Xcode 14 |
290
- | 10.2.0 | >= 0.66.0 | [3.12.0+] | 21 | 33 | >=4.3.0 | 11.0 | Deprecated, supports Xcode 14 |
291
- | 10.1.0 | >= 0.66.0 | [3.11.0+] | 21 | 33 | >=4.2.0 | 11.0 | Deprecated, supports Xcode 14 |
292
- | 10.0.0 | >= 0.66.0 | [3.10.1+] | 21 | 33 | >=4.1.0 | 11.0 | Deprecated, supports Xcode 14 |
293
- | 9.1.0 | >= 0.65.3 | [3.13.2+] | 21 | 33 | >=4.4.0 | 11.0 | Deprecated, supports Xcode 14 |
294
- | 9.0.1 | >= 0.65.3 | [3.10.1+] | 21 | 33 | >=4.1.0 | 11.0 | Deprecated, supports Xcode 14 |
295
- | 9.0.0 | >= 0.65.3 | [3.10.1+] | 21 | 33 | >=4.1.0 | 11.0 | Deprecated, supports Xcode 14 |
256
+ Confirm that the Android package name in your app matches the package name
257
+ configured in the Plaid Dashboard for the environment you are testing.
258
+
259
+ ### iOS OAuth redirects fail
260
+
261
+ Confirm that the iOS bundle identifier and redirect URI are configured in the
262
+ Plaid Dashboard for the environment you are testing.
263
+
264
+ ### Import path fails after upgrading to v13
265
+
266
+ Import from the package root only:
267
+
268
+ ```ts
269
+ import { createPlaidLinkSession } from "react-native-plaid-link-sdk";
270
+ ```
296
271
 
272
+ Do not import from `build/`, `src/`, `ios/`, or `android/` directly.
297
273
 
298
274
  ## Contributing
299
275
 
300
- See the [contributor guidelines](CONTRIBUTING.md) to learn how to contribute to the repository.
276
+ Issues and pull requests are welcome in this repository. Include the SDK
277
+ version, React Native version, Expo SDK version if applicable, platform, device
278
+ or simulator, and Link Session ID when reporting bugs.