bond-sdk-external-accounts v1.0.5
Bond External Accounts JavaScript SDK
-This overview outlines Requirements, Installation, and Usage. -The Docs folder provides Bond External Accounts SDK Documentation you can run.
Requirements
When working with Bond, you'll create API Keys to enable access to the platform. Then you're ready to build.
To use this SDK you can just import it using the steps under 'Installation'. But if you'd like to build the repo yourself, with or without sample files, you'll need:
Node installation will include NPM, which is responsible for dependency management.
Installation
NPM
To install the module in your repo use your terminal to type:
npm install bond-sdk-external-accounts
Then import it in your Javascript code:
import BondExternalAccounts from 'bond-sdk-external-accounts';
CDN
Or you can install the SDK from a CDN.
Using JS
import BondExternalAccounts from 'cdn.bond.tech/sdk/external-accounts/v1/bond-sdk-external-accounts.js';
Using HTML
Usage
This SDK relies heavily on Promises, making it easier to handle the asynchronous
requests made to the API. The SDK provides a BondExternalAccounts
object containing
several methods which map to the calls and parameters described in BondExternalAccounts API documentation.
The following snippet is a generic example of how brands can use the SDK. If you need details for a specific module, refer to the sample files.
Before executing any request, you need to authorize the calls to the Bond API:
Initialize BondExternalAccounts
- Import scripts
<script src="https://cdn.bond.tech/sdk/external-accounts/v1/bond-sdk-external-accounts.js"></script>
- Call the constructor ( "{ bondEnv: 'sandbox' }" to access the Sandbox environment )
const bondExternalAccounts = new BondExternalAccounts({ bondEnv: 'sandbox'});
The following environments are supported:
sandbox.dev
api.dev
sandbox.staging
api.staging
sandbox
api
Link account
bondExternalAccounts
.linkAccount({
accountId: [ACCOUNT_ID],
identity: [TEMP_IDENTITY_TOKEN],
authorization: [TEMP_AUTH_TOKEN],
})
Micro deposit
bondExternalAccounts
.microDeposit({
accountId: [ACCOUNT_ID],
linkedAccountId: [LINKED_ACCOUNT_ID],
identity: [TEMP_IDENTITY_TOKEN],
authorization: [TEMP_AUTH_TOKEN],
})
Available methods
Working with the Repo
The following script aliases are available:
npm run doc
: Run JSDoc to create a 'docs' folder with automatically generated documentation for the source code.npm run build
: Create a production build minified and transpiled js bundle without any sample code.npm run start
: Lint SDK and Sample files, then Deploy a web server from the root folder atlocalhost:8080
to run the html samples.
Developing the BondExternalAccounts SDK
To handle all implementation use cases, Engineers should always build this
project (npm run build
) before committing.
Include the /dist folder in your commit for customers that link to the built bond-sdk-external-accounts.js file directly.