A simple example of how to use M2M tokens with Clerk, using express.
- Head to the Clerk dashboard, to machine config
- Create two machines, called Machine A and Machine B. Make sure that the access scopes for Machine A include Machine B and vice versa. It should look something like this.
- Create a
.env
file in the/machine-a
and/machine-b
folders in this repo withcp machine-a/.env.sample machine-a/.env && cp machine-b/.env.sample machine-b/.env
- Add the machine secrets from your Clerk dashboard into the
.env
files - Run
npm start
to start the servers for machines A and B - In your browser, open
http://localhost:3000/send
to trigger machine A to send a request to machine B. You should see a response with a verified token.