react-native-plaid-link-sdk 13.0.0 → 13.0.2

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 (58) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +246 -7
  3. package/android/src/main/AndroidManifest.xml +6 -1
  4. package/android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt +1 -1
  5. package/build/ReactNativePlaidLinkSdkModule.js.map +1 -1
  6. package/build/index.d.ts.map +1 -1
  7. package/build/index.js +49 -101
  8. package/build/index.js.map +1 -1
  9. package/ios/Frameworks/LinkKit.xcframework/Info.plist +0 -17
  10. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
  11. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
  12. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +14 -0
  13. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +3 -0
  14. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +3 -0
  15. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  16. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +9 -13
  17. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
  18. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
  19. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +14 -0
  20. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3 -0
  21. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3 -0
  22. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
  23. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +14 -0
  24. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +3 -0
  25. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +3 -0
  26. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
  27. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +17 -17
  28. package/ios/ReactNativePlaidLinkSdk.podspec +0 -2
  29. package/ios/src/RNPlaidLinkSdkVersion.swift +1 -1
  30. package/package.json +40 -3
  31. package/src/ReactNativePlaidLinkSdkModule.ts +3 -3
  32. package/src/index.ts +93 -134
  33. package/.eslintrc.js +0 -5
  34. package/.gitattributes +0 -3
  35. package/.nvmrc +0 -1
  36. package/eslint.config.js +0 -3
  37. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit-Swift.h +0 -650
  38. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit.h +0 -22
  39. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/LinkKit +0 -0
  40. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.abi.json +0 -52299
  41. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.private.swiftinterface +0 -751
  42. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftdoc +0 -0
  43. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftinterface +0 -751
  44. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftmodule +0 -0
  45. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.abi.json +0 -52299
  46. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.private.swiftinterface +0 -751
  47. 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
  48. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftinterface +0 -751
  49. 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
  50. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/module.modulemap +0 -11
  51. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/Info.plist +0 -59
  52. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/PrivacyInfo.xcprivacy +0 -32
  53. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/_CodeSignature/CodeResources +0 -230
  54. package/jest.config.js +0 -21
  55. package/jest.setup.js +0 -7
  56. package/scripts/check-package-entrypoints.js +0 -146
  57. package/scripts/extract-rn-enums.js +0 -49
  58. package/tsconfig.json +0 -9
package/src/index.ts CHANGED
@@ -30,152 +30,118 @@ function cleanupListeners() {
30
30
  }
31
31
 
32
32
  export async function createPlaidLinkSession(
33
- config: LinkTokenConfiguration
33
+ config: LinkTokenConfiguration,
34
34
  ): Promise<PlaidLinkSession> {
35
- try {
36
- cleanupListeners();
37
-
38
- successSub = NativePlaidModule.addListener(
39
- "PlaidLink.onSuccess",
40
- (success: LinkSuccess) => {
41
- config.onSuccess(success);
42
- cleanupListeners();
43
- }
44
- );
45
-
46
- exitSub = NativePlaidModule.addListener("PlaidLink.onExit", (exit: LinkExit) => {
35
+ cleanupListeners();
36
+
37
+ successSub = NativePlaidModule.addListener(
38
+ "PlaidLink.onSuccess",
39
+ (success: LinkSuccess) => {
40
+ config.onSuccess(success);
41
+ cleanupListeners();
42
+ },
43
+ );
44
+
45
+ exitSub = NativePlaidModule.addListener(
46
+ "PlaidLink.onExit",
47
+ (exit: LinkExit) => {
47
48
  config.onExit(exit);
48
49
  cleanupListeners();
49
- });
50
+ },
51
+ );
50
52
 
51
- eventSub = NativePlaidModule.addListener("PlaidLink.onEvent", (event: LinkEvent) => {
53
+ eventSub = NativePlaidModule.addListener(
54
+ "PlaidLink.onEvent",
55
+ (event: LinkEvent) => {
52
56
  config.onEvent(event);
53
- });
54
-
55
- await NativePlaidModule.createPlaidLinkSession(config.token);
57
+ },
58
+ );
56
59
 
57
- console.log("[PlaidLink] createPlaidLinkSession - returning session");
60
+ await NativePlaidModule.createPlaidLinkSession(config.token);
58
61
 
59
- return {
60
- open: (fullScreen = false) => {
61
- console.log("[PlaidLink] open called", fullScreen);
62
- return NativePlaidModule.openLinkSession(fullScreen);
63
- },
64
- };
65
- } catch (e) {
66
- console.error("[PlaidLink] createPlaidLinkSession failed:", e);
67
- throw e;
68
- }
62
+ return {
63
+ open: (fullScreen = false) => NativePlaidModule.openLinkSession(fullScreen),
64
+ };
69
65
  }
70
66
 
71
67
  export async function createPlaidLayerSession(
72
- config: LayerTokenConfiguration
68
+ config: LayerTokenConfiguration,
73
69
  ): Promise<PlaidLayerSession> {
74
- try {
75
- cleanupListeners();
76
-
77
- console.log("[PlaidLink] createPlaidLayerSession - setting up listeners");
78
- console.log(
79
- "[PlaidLink] onEvent callback provided:",
80
- typeof config.onEvent
81
- );
82
-
83
- successSub = NativePlaidModule.addListener(
84
- "PlaidLink.onSuccess",
85
- (success: LinkSuccess) => {
86
- console.log("[PlaidLink] JS received onSuccess event");
87
- config.onSuccess(success);
88
- cleanupListeners();
89
- }
90
- );
91
-
92
- exitSub = NativePlaidModule.addListener("PlaidLink.onExit", (exit: LinkExit) => {
93
- console.log("[PlaidLink] JS received onExit event");
70
+ cleanupListeners();
71
+
72
+ successSub = NativePlaidModule.addListener(
73
+ "PlaidLink.onSuccess",
74
+ (success: LinkSuccess) => {
75
+ config.onSuccess(success);
76
+ cleanupListeners();
77
+ },
78
+ );
79
+
80
+ exitSub = NativePlaidModule.addListener(
81
+ "PlaidLink.onExit",
82
+ (exit: LinkExit) => {
94
83
  config.onExit?.(exit);
95
84
  cleanupListeners();
96
- });
85
+ },
86
+ );
97
87
 
98
- eventSub = NativePlaidModule.addListener("PlaidLink.onEvent", (event: LinkEvent) => {
99
- console.log("[PlaidLink] JS received onEvent:", event.eventName);
88
+ eventSub = NativePlaidModule.addListener(
89
+ "PlaidLink.onEvent",
90
+ (event: LinkEvent) => {
100
91
  config.onEvent?.(event);
101
- });
102
-
103
- console.log("[PlaidLink] Listeners registered, creating native session");
104
- await NativePlaidModule.createPlaidLayerSession(config.token);
105
-
106
- console.log("[PlaidLink] createPlaidLayerSession - returning session");
107
-
108
- return {
109
- open: () => {
110
- console.log("[PlaidLink] layer open called");
111
- return NativePlaidModule.openLayerSession();
112
- },
113
- submit: (data: SubmissionData) => {
114
- console.log("[PlaidLink] layer submit called", data);
115
- return NativePlaidModule.submitLayerData(
116
- data.phoneNumber,
117
- data.dateOfBirth,
118
- data.params
119
- );
120
- },
121
- };
122
- } catch (e) {
123
- console.error("[PlaidLink] createPlaidLayerSession failed:", e);
124
- throw e;
125
- }
92
+ },
93
+ );
94
+
95
+ await NativePlaidModule.createPlaidLayerSession(config.token);
96
+
97
+ return {
98
+ open: () => NativePlaidModule.openLayerSession(),
99
+ submit: (data: SubmissionData) =>
100
+ NativePlaidModule.submitLayerData(
101
+ data.phoneNumber,
102
+ data.dateOfBirth,
103
+ data.params,
104
+ ),
105
+ };
126
106
  }
127
107
 
128
108
  export async function createPlaidHeadlessSession(
129
- config: LinkTokenConfiguration
109
+ config: LinkTokenConfiguration,
130
110
  ): Promise<PlaidHeadlessSession> {
131
- try {
132
- cleanupListeners();
133
-
134
- console.log(
135
- "[PlaidLink] createPlaidHeadlessSession - setting up listeners"
136
- );
137
-
138
- successSub = NativePlaidModule.addListener(
139
- "PlaidLink.onSuccess",
140
- (success: LinkSuccess) => {
141
- console.log("[PlaidLink] JS received onSuccess event");
142
- config.onSuccess(success);
143
- cleanupListeners();
144
- }
145
- );
146
-
147
- exitSub = NativePlaidModule.addListener("PlaidLink.onExit", (exit: LinkExit) => {
148
- console.log("[PlaidLink] JS received onExit event");
111
+ cleanupListeners();
112
+
113
+ successSub = NativePlaidModule.addListener(
114
+ "PlaidLink.onSuccess",
115
+ (success: LinkSuccess) => {
116
+ config.onSuccess(success);
117
+ cleanupListeners();
118
+ },
119
+ );
120
+
121
+ exitSub = NativePlaidModule.addListener(
122
+ "PlaidLink.onExit",
123
+ (exit: LinkExit) => {
149
124
  config.onExit(exit);
150
125
  cleanupListeners();
151
- });
126
+ },
127
+ );
152
128
 
153
- eventSub = NativePlaidModule.addListener("PlaidLink.onEvent", (event: LinkEvent) => {
154
- console.log("[PlaidLink] JS received onEvent:", event.eventName);
129
+ eventSub = NativePlaidModule.addListener(
130
+ "PlaidLink.onEvent",
131
+ (event: LinkEvent) => {
155
132
  config.onEvent(event);
156
- });
157
-
158
- console.log(
159
- "[PlaidLink] Listeners registered, creating native headless session"
160
- );
161
- await NativePlaidModule.createPlaidHeadlessSession(config.token);
162
-
163
- console.log("[PlaidLink] createPlaidHeadlessSession - returning session");
164
-
165
- if (config.onLoad) {
166
- config.onLoad();
167
- }
168
-
169
- return {
170
- start: () => {
171
- console.log("[PlaidLink] headless start called");
172
- return NativePlaidModule.startHeadlessSession();
173
- },
174
- };
175
- } catch (e) {
176
- console.error("[PlaidLink] createPlaidHeadlessSession failed:", e);
177
- throw e;
133
+ },
134
+ );
135
+
136
+ await NativePlaidModule.createPlaidHeadlessSession(config.token);
137
+
138
+ if (config.onLoad) {
139
+ config.onLoad();
178
140
  }
141
+
142
+ return {
143
+ start: () => NativePlaidModule.startHeadlessSession(),
144
+ };
179
145
  }
180
146
 
181
147
  export async function syncFinanceKit(config: {
@@ -187,18 +153,11 @@ export async function syncFinanceKit(config: {
187
153
  throw new Error("FinanceKit is only available on iOS");
188
154
  }
189
155
 
190
- try {
191
- console.log("[PlaidLink] syncFinanceKit called");
192
- await NativePlaidModule.syncFinanceKit(
193
- config.token,
194
- config.requestAuthorizationIfNeeded ?? true,
195
- config.syncBehavior ?? FinanceKitSyncBehavior.LIVE
196
- );
197
- console.log("[PlaidLink] syncFinanceKit completed successfully");
198
- } catch (e) {
199
- console.error("[PlaidLink] syncFinanceKit failed:", e);
200
- throw e;
201
- }
156
+ await NativePlaidModule.syncFinanceKit(
157
+ config.token,
158
+ config.requestAuthorizationIfNeeded ?? true,
159
+ config.syncBehavior ?? FinanceKitSyncBehavior.LIVE,
160
+ );
202
161
  }
203
162
 
204
163
  export {
package/.eslintrc.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ['universe/native', 'universe/web'],
4
- ignorePatterns: ['build'],
5
- };
package/.gitattributes DELETED
@@ -1,3 +0,0 @@
1
- # Windows files should use crlf line endings
2
- # https://help.github.com/articles/dealing-with-line-endings/
3
- *.bat text eol=crlf
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 20.19.4
package/eslint.config.js DELETED
@@ -1,3 +0,0 @@
1
- const config = require('eslint-config-universe/flat/native');
2
-
3
- module.exports = config;