import Fortmatic from 'fortmatic';
const fm = new Fortmatic('YOUR_API_KEY');
window.web3 = new Web3(fm.getProvider());
// Sync functions that returns users' addresses if they are already logged in with enable().
// Not recommended as sync functions will be deprecated in web3 1.0
console.log(web3.eth.accounts); // ['0x...']
console.log(web3.eth.coinbase); // '0x...'
// Async functions that triggers login modal, if user not already logged in
web3.eth.getAccounts((error, accounts) => {
console.log(accounts); // ['0x...']
web3.eth.getCoinbase((error, coinbase) => {
console.log(coinbase); // '0x...'