Within your server-side application, you’ll generate a single-use access token that contains information needed to securely communicate with your Moov account. Once you’ve generated this token, you can use it to make calls from the server or send it back to your client to use with Moov.js.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import{Moov,SCOPES}from'@moovio/node';constmoov=newMoov({accountID:"YOUR_MOOV_ACCOUNT_ID",publicKey:"PUBLIC_KEY",secretKey:"PRIVATE_KEY",domain:"YOUR_DOMAIN"});constscopes=[SCOPES.ACCOUNTS_CREATE];try{const{token}=awaitmoov.generateToken(scopes);// Do something with token
}catch(err){// Handle any errors
}