0.0.10 • Published 2 years ago
@atomfinance/atom-web-sdk v0.0.10
atom-web-sdk
Our Atom Finance web SDK.
This SDK allows our B2B partners to interact with Atom content in their own application or website.
Install
With npm
$ npm i @atomfinance/atom-web-sdk
With yarn
$ yarn add @atomfinance/atom-web-sdk
How it works
This SDK exports one function (renderAtomContent
) that creates an iFrame with Atom content sourced from platform.atom.finance. renderAtomContent
takes in the following parameters:
partnerID: string
: unique ID identifying the partner calling the functiontoken: string
: unique user Id token identifying the user accessing the Atom contentiFrameElementID: string
: id of the iframe element embedding the atom contentcbackFcn?: () => void
: a partner supplied callback function that can be called from within the iframe. This can be used to trigger a custom event, such as redirecting to a new page.
Example
If you wanted to call this function, it would look something like this.
renderAtomContent(
'atom-partner-123',
'userToken123',
'atom-content-parent',
() => console.log('hello from within the iframe!')
)
Demo
Check out our demo here!