loginWithPasskey()
, the SDK stores the session and active client in localStorage. The signing key material remains securely stored in the browser’s IndexedDB and is never extractable. Turnkey uses this public key to scope and encrypt the session to the appropriate user.
Steps using @turnkey/sdk-react
This process is made seamless by leveraging our React package. Read on for a non-React implementation below.
1
Initialize the React Provider
2
Login with a Passkey and Create a Session
3
Use the session to make requests
getActiveClient()
returns the currently active client (e.g. IndexedDb-backed), refreshing automatically if needed.Alternative Steps (non-React)
1
Initialize the Passkey and IndexedDB Clients
2
Login with a Passkey and Create a Session
3
Use the session to make requests
loginWithPasskey
completes, the session is stored in localStorage and all requests are signed using the IndexedDb-backed keypair.