I couldn't find any good documentation on this.
Say I had a third party library / api and I wanted to implement it into an angular 2 directive. How would I do that?
Given the following:
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
<script>
var linkHandler = Plaid.create({
env: 'sandbox',
clientName: 'Plaid Sandbox',
// Replace '<PUBLIC_KEY>' with your own `public_key`
key: '#####',
product: ['auth'],
onSuccess: function(public_token, metadata) {
// Send the public_token to your app server here.
// The metadata object contains info about the
// institution the user selected and the
// account_id, if selectAccount is enabled.
console.log("Token: " + public_token + " Metadata: " + metadata);
},
onExit: function(err, metadata) {
// The user exited the Link flow.
if (err != null) {
console.log("Error: " + err);
}
// metadata contains information about the
// institution that the user selected and the
// most recent API request IDs. Storing this
// information can be helpful for support.
}
});
// Trigger the standard institution select view
document.getElementById('link-button').onclick = function() {
linkHandler.open();
};