Repository navigation
Support session_duration_minutes and session_custom_claims in authenticateJwt - #463
Merged
Merged
Conversation
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:36 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:36 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:36 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:47 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:47 — with
GitHub Actions
Error
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:47 — with
GitHub Actions
Failure
jlai-stytch
force-pushed
the
jlai/session_duration
branch
from
June 10, 2026 18:48
54338d3 to
dbea80a
Compare
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:48 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:48 — with
GitHub Actions
Error
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:48 — with
GitHub Actions
Error
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:58 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:58 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:58 — with
GitHub Actions
Failure
jlai-stytch
force-pushed
the
jlai/session_duration
branch
from
June 10, 2026 18:59
665bd8d to
daa50ef
Compare
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:59 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:59 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 10, 2026 18:59 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 17:51 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 17:51 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 17:51 — with
GitHub Actions
Failure
logan-twilio
approved these changes
Jun 22, 2026
logan-twilio
left a comment
Contributor
There was a problem hiding this comment.
This should realistically be a MINOR bump instead of a PATCH since it's adding new functionality
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 23:28 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 23:28 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 23:28 — with
GitHub Actions
Failure
jlai-stytch
force-pushed
the
jlai/session_duration
branch
from
June 22, 2026 23:29
39dfedc to
d36e30e
Compare
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 23:29 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 23:29 — with
GitHub Actions
Failure
jlai-stytch
had a problem deploying
to
integration_tests
June 22, 2026 23:29 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for the
session_duration_minutesandsession_custom_claimsparams inauthenticateJwt()for both B2B and ConsumerThis method is manually generated (i.e. not managed by codegen), so I believe this doesn't require changes elsewhere. I ran
npm run build.The logic mirrors the Ruby and Go SDK's logic which currently supports
session_duration_minutesas a param: https://github.com/stytchauth/stytch-ruby/blob/32cf1771b62e0b8ac320f6d1d955cc061fd2c888/lib/stytch/b2b_sessions.rb#L628-L678https://github.com/stytchauth/stytch-go/blob/87c4a9068c1e2dad24acbc151f15b6eb642f86a3/stytch/b2b/sessions.go#L446-L448
session_duration_minutesif the JWT is verified locallymax_token_age_seconds = 0Motivation
Customer request from the community Slack: https://app.plain.com/workspace/w_01HAQ5N757DAG0R7JTXZ4MQYKY/thread/th_01KTS9YSFQJ7KRDEXBJ3NQVA9M/
Our API docs say you can pass in
session_duration_minutesto extend a Session's lifetime (when the auth doesn't happen locally): https://stytch.com/docs/api-reference/b2b/api/sessions/authenticate-jwtbut from what I found, only some of our backend SDKs currently support this param today, like Ruby and Go:
Ruby:
https://github.com/stytchauth/stytch-ruby/blob/32cf1771b62e0b8ac320f6d1d955cc061fd2c888/lib/stytch/b2b_sessions.rb#L628-L678
Golang:
https://github.com/stytchauth/stytch-go/blob/87c4a9068c1e2dad24acbc151f15b6eb642f86a3/stytch/b2b/sessions.go#L435-L459
but not Python and Java:
Python:
https://github.com/stytchauth/stytch-python/blob/6987801e7eb03b0c6b34dc46f042e5d532e7299a/stytch/b2b/api/sessions.py#L806-L856
Java:
https://github.com/stytchauth/stytch-java/blob/f85a264f20b2a50132acefbbd27d99c9bd17865c/stytch/src/main/kotlin/com/stytch/java/b2b/api/sessions/Sessions.kt#L458-L471
Action item for the future would be to add this to the rest of the backend SDKs for parity
Testing