Skip to content

How to create a new API key and validate and API using node

Notifications You must be signed in to change notification settings

thatapicompany/theauthapi-code-demo-1

Repository files navigation

How to create a new API key and validate and API using node

Watch this short video

A video on how to setup the code

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-...

Create your first key

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

About

How to create a new API key and validate and API using node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published