Skip to content

chore(backend): Support min remaining ttl for m2m token creation#8513

Merged
wobsoriano merged 3 commits intomainfrom
rob/user-5290-add-min_remaining_ttl_seconds-to-sdk-m2m-create-endpoint
May 8, 2026
Merged

chore(backend): Support min remaining ttl for m2m token creation#8513
wobsoriano merged 3 commits intomainfrom
rob/user-5290-add-min_remaining_ttl_seconds-to-sdk-m2m-create-endpoint

Conversation

@wobsoriano
Copy link
Copy Markdown
Member

Description

Add minRemainingTtlSeconds to clerkClient.m2m.createToken().

This maps to the backend API field min_remaining_ttl_seconds for POST /m2m_tokens.

Resolves USER-5290

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:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: 27eaca1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@clerk/backend Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 8, 2026 5:05pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 4e9683f5-8474-4274-814f-510d267eb892

📥 Commits

Reviewing files that changed from the base of the PR and between 5cda3ee and 27eaca1.

📒 Files selected for processing (3)
  • .changeset/kind-ravens-collect.md
  • packages/backend/src/api/__tests__/M2MTokenApi.test.ts
  • packages/backend/src/api/endpoints/M2MTokenApi.ts

📝 Walkthrough

Walkthrough

This pull request adds an optional minRemainingTtlSeconds parameter to M2M token creation in the Clerk backend SDK. The parameter enables server-side token reuse when an existing token has at least the specified remaining TTL. The change includes: type definition extending CreateM2MTokenParams, method implementation extracting and forwarding the parameter in the POST request body, updated tests validating parameter inclusion with value 240, and a Changesets entry documenting the new feature with usage example.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding support for min remaining TTL parameter to M2M token creation.
Description check ✅ Passed The description is directly related to the changeset, explaining the new minRemainingTtlSeconds parameter, its API mapping, and the resolved issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 8, 2026

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8513

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8513

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8513

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8513

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8513

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8513

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8513

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8513

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8513

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8513

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8513

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8513

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8513

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8513

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8513

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8513

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8513

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8513

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8513

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8513

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8513

commit: 27eaca1

Copy link
Copy Markdown
Member

@jacekradko jacekradko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wobsoriano wobsoriano merged commit 0ab09a8 into main May 8, 2026
43 checks passed
@wobsoriano wobsoriano deleted the rob/user-5290-add-min_remaining_ttl_seconds-to-sdk-m2m-create-endpoint branch May 8, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants