Reputation: 57
I am trying to integrate Plaid into an Expo app for the first time and am a bit confused on the integration process.
I have been following the following guides:
https://github.com/plaid/react-native-plaid-link-sdk
https://plaid.com/docs/link/link-token-migration-guide/
One thing that has been confusing for me is the process of generating a new token using "/link/token/create". What exactly does this mean and where do I perform "/link/token/create" in order to fetch this token?
Thank you!
edit:
As based on the first link, I have the following:
<View style={styles.container}>
<Text style={styles.title}>Tab One</Text>
<PlaidLink
tokenConfig={{
token: '#GENERATED_LINK_TOKEN#',
}}
onSuccess={(success: LinkSuccess) => {
console.log(success);
}}
onExit={(exit: LinkExit) => {
console.log(exit);
}}
>
<Text>Add Account</Text>
</PlaidLink>
</View>
Upvotes: 1
Views: 2485
Reputation: 1853
Have you checked out the Quickstart? It has a sample implementation showing how /link/token/create
is used.
More fundamentally, your sample code is all frontend sample code. Plaid apps need both a frontend (to display Link) and a backend (to call the API) -- all Plaid API calls (including to /link/token/create
) need to be made from the backend. When your user expresses an intent to link a Plaid account, your frontend should trigger the backend to call /link/token/create
, and the backend should then pass that token to the frontend to be used in initializing Link.
Upvotes: 2