feat(js-sdk)!: Grant auth#405
Open
SeverinAlexB wants to merge 17 commits into
Open
Conversation
8 tasks
andrei-21
reviewed
May 29, 2026
Contributor
andrei-21
left a comment
There was a problem hiding this comment.
I reviewed Rust code. Later I will try to run JS code.
andrei-21
reviewed
May 29, 2026
Contributor
andrei-21
left a comment
There was a problem hiding this comment.
I played with that, seems to work. Just a couple of comments to make the readme correct.
andrei-21
approved these changes
May 29, 2026
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.
Adds grant-backed auth support to the JS SDK to make it feature complete to the rust SDK.
Updates JS examples to make them work with the new SDK.
What changed
GrantAuthFlowbindings for starting, resuming, saving, polling, and awaiting grant-backed pubkyauth flows.Pubky.startGrantAuthFlow(...)andPubky.resumeGrantAuthFlow(...).SigninGrantDeepLinkSignupGrantDeepLinkSession.exportSecret()and updatedPubky.restoreSession(...)to restore grant credentials by minting a fresh bearer.InFlightGuardlogic so auth flows reject overlapping async calls cleanly.signup(...)+signin(clientId).examples/javascript:node <script>.mjs0-check-testnet.mjsWhat this is not doing: It is not adding more examples or optimizing the examples really. This will be done in another task. See #401 .
Caveats
I am not 100% content with the API surface yet. Nonetheless at the moment, I rather ship something working than delay the project. In subsequent versions, we should optimize it further.