Step 1: Vault Setup
To get up and running on the io.network first we'll need to create an MPC in order to store and send
- Register a Device (so you can sign transactions securely)
- Create a Vault (where your assets live)
- Generate API Keys (to interact programmatically)
1. Register your Device
Before you can do anything, you need to register a device. Follow the simple steps in our device registration guide to get set up.
2. Create a Vault
Once your device is linked, it’s time to create a vault—this is where your assets will be stored and managed. Check out the vault creation guide for the exact steps.
3. Generate API Credentials
Now that you have a vault, you need an API key to interact with it programmatically.
- Log in to the Io Vault Dashboard
- Go to Settings > API Keys
- Click Create API Key
Save your Client ID and Client Secret somewhere safe (you won’t see them again!)
Your API credentials will look like this:
Client ID: 16fc281f-b6ca-4e21-9bf0-53887253db85
Client Secret: Px7&nKFKx8vcjxeief256wX&...
4. Authenticate and Get an Access Token
Vault's API's implement the 0Auth specification; so now that you have your client ID and secret, you'll be able to use those values to obtain an access token.
const authResponse = await fetch('https://api.iofinnet.com/auth/v1/accessToken', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
clientId: '<client_id>',
clientSecret: '<client_secret>'
})
});
const { accessToken } = await authResponse.json();
The access token returned from this request should be passed in the "Authorization" header later on when using our API endpoints.
headers: { 'Authorization': `Bearer ${accessToken}` }
For more information on authentication head to our Authentication API reference.
Updated about 16 hours ago