0.2.0 • Published 3 days ago

@turnkey/sdk-browser v0.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 days ago

@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