Skip to content

Allow overriding stamper config in core. Scope loginWithPasskey to certain passkeys#1158

Open
amircheikh wants to merge 1 commit intomainfrom
amir/stamper-override
Open

Allow overriding stamper config in core. Scope loginWithPasskey to certain passkeys#1158
amircheikh wants to merge 1 commit intomainfrom
amir/stamper-override

Conversation

@amircheikh
Copy link
Contributor

Summary & Motivation

It is now possible to recreate the stampers that are initialized by default in @turnkey/core's core client.

This allows you to dynamically swap out certain configurations during runtime without re-initializing the entire client.

This enables us to include an optional allowedCredentials array in the loginWithPasskey function as requested
Demo of this case:

Screen.Recording.2025-12-22.at.4.05.52.PM.mov

How I Tested These Changes

Locally in with-sdk-js demo

Did you add a changeset?

Will after reviews.

Open question

In @turnkey/react-wallet-kit, should we automatically run this new function whenever we detect changes to the TurnkeyProvider config for the specific stamper? Right now, modifying the passkeyConfig and walletConfig in the TurnkeyProvider at runtime does not dynamically update it!

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 22, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e0458c8:

Sandbox Source
@turnkey/example-react-components Configuration

@amircheikh amircheikh force-pushed the amir/stamper-override branch from 6d19717 to e0458c8 Compare December 22, 2025 21:22
* @returns A promise that resolves when the stamper and HTTP client have been updated.
* @throws {TurnkeyError} If there is an error initializing the new stamper.
*/
overrideApiKeyStamper = async (
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this function should instead take a public key and an optional private key, and with those, override the stamper to use that key pair.

If a user just passes a public key, it uses it's associated private key in indexed db (not sure how that would work in practice), and if they pass both we use both (insanely insecure but maybe there is a niche use case for that)

@moeodeh3 moeodeh3 mentioned this pull request Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants