The module to interact with the Auth0Management API
- Clone the repo:
git clone https://github.com/auth0-blog/auth0-management-api.git
- Add Auth0 credentials to a new
.env
file. - Run
npm install
to install the dependencies. - Run files with the command
node get-client.js
andnode update-client.js
. - See changes in newly created file,
client-data.json
.
- Have an Auth0 account and an account name.
- Have a management API: https://manage.auth0.com/dashboard/us/{CLIENT}/apis
- Requests an access token using client_id and client_secret
- Uses the access token to create a new ManagementClient
- Use the ManagementClient to interact with the API: https://auth0.github.io/node-auth0/index.html
const Auth0Manager = require('./Auth0Manager');
Auth0Manager
.init()
.then(() => Auth0Manager.getClient())
.then(client => res.json(client))
.catch(err => res.json({ message: 'There was an error!', ...err }));