Install - The Auth API NPM library
npm i thauthapi dotenv
Head to the https://theauthapi.com to create your account, project, access key.
Create a new .env file
touch .env
Copy your new project id and access key into a .env file
ACCESS_TOKEN=test_access_...
TEST_KEY=
PROJECT_ID=c7b59b82-...
Update the createKey.js
file to include the 2 required fields:
name : [name]
(Read our API docs)[https://docs.theauthapi.com/] about the additional properties you can send on the request.
Now run
node createKey.js
After creating your key, you can copy the key into your .env to run it's first validation.
ACCESS_TOKEN=test_access_...
TEST_KEY=test_BXskhoH96...
PROJECT_ID=c7b59b82-...
Now run the key validation script to check it's valid
node validateKey.js