Skip to content

Commit

Permalink
Add support for Link Tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrusstoller committed Feb 25, 2021
1 parent e189dff commit 1ae252a
Show file tree
Hide file tree
Showing 5 changed files with 1,108 additions and 1,069 deletions.
20 changes: 19 additions & 1 deletion PlaidLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,23 @@ export default {
return ['sandbox', 'development', 'production'].indexOf(value) !== -1
}
},
public_key: String,
isWebview: {
type: Boolean,
required: false
},
link_token: {
type: String,
required: false
},
public_key: {
type: String,
required: false
},
products: Array,
receivedRedirectUri: {
type: String,
required: false
},
webhook: {
type: String,
required: false
Expand Down Expand Up @@ -51,8 +66,11 @@ export default {
this.plaid.create({
clientName: this.clientName,
env: this.env,
isWebview: this.isWebview,
key: this.public_key,
product: this.products,
receivedRedirectUri: this.receivedRedirectUri,
token: this.link_token,
// Optional – use webhooks to get transaction and error updates
webhook: this.webhook,
onLoad: function() {
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ yarn add vue-plaid-link2

## Usage

This is based on this [Plaid documentation](https://plaid.com/docs/link/web/).
This component supports both `link_tokens` and the deprecated `public_key`.
For clarity, you should only use one or the other, not both.

```vue
<script>
import vue from 'vue';
Expand All @@ -46,6 +50,7 @@ export default {
<PlaidLink
clientName="APPLICATION NAME"
env="sandbox"
link_token="GENERATED LINK TOKEN"
public_key="PLAID PUBLIC KEY"
:products="['auth','transactions']"
webhook="https://requestb.in"
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"babel-eslint": "^10.1.0",
"eslint": "^7.2.0",
"eslint-plugin-vue": "^6.2.2",
"eslint-plugin-vue": "^7.6.0",
"vue": "^2.6.11",
"vue-plaid-link2": "file:.."
},
Expand Down
Loading

0 comments on commit 1ae252a

Please sign in to comment.