Skip to content

refactor(backend): Use m2m tokens instead of machine tokens #6484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2025

Conversation

wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Aug 6, 2025

Description

We had a conversation about naming because the actual canonical name is "m2m tokens" or "machine-to-machine tokens" instead of just "machine tokens". Doing "machine tokens" may confuse devs since we also have "machines" and "machine secrets" tied to a machine.

So to create machines, one will do:

const machine = await clerkClient.machines.create({...})

and to mint a m2m token for that machine

const m2mToken = await clerkClient.m2mToken.create({ machineSecretKey: machine.secretKey })

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Aug 6, 2025

⚠️ No Changeset found

Latest commit: 475a124

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 11 packages
Name Type
@clerk/backend Minor
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2025 11:53pm

@wobsoriano wobsoriano merged commit 28ba427 into rob/user-2264-m2m-auth Aug 6, 2025
12 checks passed
@wobsoriano wobsoriano deleted the rob/machine-token-to-m2m-token branch August 6, 2025 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants