Skip to content

Latest commit

 

History

History

sdk-browser

@turnkey/sdk-browser

npm

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