Skip to main content

M2M Tokens Public Beta

Category
M2M
Published

We're excited to announce that M2M tokens are now available in public beta, bringing secure authentication for communication between your backend services.

M2M tokens are designed specifically for authenticating requests between different machines within your backend infrastructure. Whether you're building microservices, background workers, or distributed systems, M2M tokens provide a secure way for your services to communicate with each other.

This is distinct from our other machine authentication offerings:

Configure Machine Communication with Ease

Create and configure machines directly from the Clerk Dashboard or via our API or SDKs. You have complete control over which machines can communicate with each other, allowing you to implement the principle of least privilege across your infrastructure.

Tokens can be customized with:

  • Custom claims to pass additional context between services
  • Configurable expiration times for enhanced security
  • Instant revocation when you need to immediately cut off access

Simple Integration

Creating and verifying M2M tokens is straightforward with our SDKs:

// Create a token on Machine A
const m2mToken = await clerkClient.m2m.createToken()

// Send authenticated request to Machine B
await fetch('<machine-b-url>', {
  headers: {
    Authorization: `Bearer ${m2mToken.token}`,
  },
})

// Verify the token on Machine B
const verified = await clerkClient.m2m.verifyToken({ token })

Pricing

M2M tokens are free to use during the beta period. After general availability, they'll move to a simple usage-based pricing model. The pricing will be:

  • $0.001 per token creation
  • $0.0001 per token verification (for opaque tokens)

We'll provide usage stats, monitoring, and rate limiting in the Dashboard before the beta period ends, so you'll have complete visibility and control over your usage and costs. We're also planning to add support for JWT tokens before the beta period ends, which will only incur charges for creation, not verification.

Get Started Today

Ready to secure your backend service communication? Check out our resources to get started:

We'd love to hear your feedback as you try out M2M tokens. Your input during the beta period will help us refine the feature and ensure it meets your needs. Have questions or suggestions? Reach out through our feedback portal or join the discussion in our Discord community.

Contributors
Jeff Escalante
Brandon Romano
Robert Soriano
Ben Werner

Share this article