This page will help you get started with WEB SDK
- Load init script in your html page. If you use SPA just add it to index.html
<script src="https://sdk.whitebird.io/v1.1/script-builder.js"></script>
- Place exchange button to the body of your page
<div id="WhitebirdButton"></div>
- Add button click handler
whitebirdSdk.insertButton('#WhitebirdButton', {
sdkUrl: 'https://sdk.whitebird.io/v1.1/',
title: 'Whitebird with Whitebird',
buttonName: 'Exchange',
w: '550',
h: '600',
onClose: () => {},//close sdk callback
});
- Prepare exchange request using preorder result. For example, this request could be called when you client ready to click to sdk button
whitebirdSdk.buildW({
id: preOrder.id,
lang: 'en'
});
- Prepare linked client sdk token. This token - is an identifier of the user, who will act with the exchange operation. For example, this request could be called when you client ready to click to sdk button. Also you can call it with step 4 request
whitebirdSdk.assignToken({ token:'token'})
- Run application and click to the button!