Authereum
Search…
Getting started
Get started with Authereum using a few lines of code
To get started, install the authereum package from NPM:
1
npm install authereum
Copied!
Now instantiate Authereum with the desired network:
1
import Authereum from 'authereum'
2
3
const authereum = new Authereum('kovan')
Copied!
If you're used to using Web3.js for your dapp, Authereum can be a drop-in replacement web3 provider.
1
import Authereum from 'authereum'
2
import Web3 from 'web3'
3
4
const authereum = new Authereum('kovan')
5
6
const provider = authereum.getProvider()
7
const web3 = new Web3(provider)
8
9
await provider.enable()
10
11
const accounts = await web3.eth.getAccounts()
12
console.log(accounts[0])
Copied!
That's it!
You can make web3 calls as you normally would. Take a look at more web3 provider examples.
Last modified 1yr ago
Copy link