Bitski.js
Current version: 0.0.1
Bitski JS SDK is a JavaScript library that connects your DApp with a user, a wallet, and a connection to the Ethereum blockchain (currently Kovan TestNet only).
Getting Started
You’ll first need a client id token from us. If you’re interested in getting one, please Contact Us.
Installation
You can easily get started by adding these two script tags to your app’s <head>
:
<script src="https://rawgit.com/OutThereLabs/bitski-js-sdk/master/lib/bitski.js"></script>
Note: We will be moving to a dedicated CDN soon.
Then, where you would normally check for Web3, you can run the Bitski SDK instead of falling back to displaying Metamask installation instructions:
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
var bitskiInstance = new bitski.Bitski('<YOUR-CLIENT-ID>');
web3 = bitskiInstance.getWeb3();
}
Alternatively you can use our connect button:
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
var bitskiInstance = new bitski.Bitski('<YOUR-CLIENT-ID>');
var connectButton = bitskiInstance.getConnectButton();
connectButton.completion = function(web3, error, user) {
window.web3 = web3;
document.body.removeChild(connectButton.element);
}
document.body.appendChild(connectButton.element);
}
You can also require your users to use a Bitski wallet & account by setting window.web3
without the check, which should override any existing Metamask or DApp browser providers.
var bitskiInstance = new bitski.Bitski('<YOUR-CLIENT-ID>');
web3 = bitskiInstance.getWeb3();
More Info