@turnkey/sdk-browser
v1.8.0
Published
Javascript Browser SDK
Downloads
83,242
Keywords
Readme
@turnkey/sdk-browser
A SDK client with browser-specific abstractions for interacting with Turnkey API. Also includes @turnkey/http, a lower-level, fully typed HTTP client.
Turnkey API documentation lives here: https://docs.turnkey.com.
Getting started
$ npm install @turnkey/sdk-browser
import {
TurnkeyBrowserSDK,
TurnkeySDKBrowserConfig,
TurnkeySDKBrowserClient,
} from "@turnkey/sdk-browser";
// This config contains parameters including base URLs, iframe URLs, org ID, and rp ID (relying party ID for WebAuthn)
import turnkeyConfig from "./turnkey.json";
// Use the config to instantiate a Turnkey Client
const turnkeyClient = new TurnkeyBrowserSDK(turnkeyConfig);
// Now you can make authenticated requests!
const response = await turnkeyClient?.passkeySign.login();
Helpers
@turnkey/sdk-browser
provides TurnkeySDKBrowserClient
, which offers wrappers around commonly used Turnkey activities, such as creating new wallets and wallet accounts.
// TODO: // - explain subtypes within sdk-client.ts // - point to demo wallet