Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.0xkey.io/llms.txt

Use this file to discover all available pages before exploring further.

Organization setup

Create a 0xkey organization in the Dashboard (or use the local stack via ./local-dev.sh start). Follow Account setup if you have not done this yet. For Embedded Wallets, enable the Auth Proxy in Dashboard → Auth (Wallet Kit). Copy your Organization ID and Auth Proxy config ID — you will pass them to the client.
1

Enable Auth Proxy

Turn on Auth Proxy and choose auth methods (for example Email OTP and Passkeys).
2

Copy IDs

Save Organization ID and Auth Proxy config ID for your app config.
See Auth Proxy for endpoint details and allowed-origins configuration.

Installation

npm install @0xkey-io/core
Using React? Prefer @0xkey-io/react-wallet-kit — it wraps @0xkey-io/core with UI, hooks, and Auth Proxy defaults.

Client initialization

Unlike React Wallet Kit, @0xkey-io/core has no provider or hooks. You work directly with ZeroXKeyClient.
import { ZeroXKeyClient } from "@0xkey-io/core";

const client = new ZeroXKeyClient({
  organizationId: process.env.NEXT_PUBLIC_ORGANIZATION_ID!,
  authProxyConfigId: process.env.NEXT_PUBLIC_AUTH_PROXY_CONFIG_ID!,
  apiBaseUrl: process.env.NEXT_PUBLIC_BASE_URL, // optional; defaults to https://api.0xkey.io
  authProxyUrl: process.env.NEXT_PUBLIC_AUTH_PROXY_URL, // optional; defaults to https://authproxy.0xkey.com
});

await client.init();
init() is required — it sets up storage, stampers, and the HTTP client.

Local development

When using local-gateway (*.0xkey.com in /etc/hosts):
VariableLocal value
NEXT_PUBLIC_BASE_URLhttps://api.0xkey.com
NEXT_PUBLIC_AUTH_PROXY_URLhttps://auth.0xkey.com
NEXT_PUBLIC_ORGANIZATION_IDFrom /tmp/0xkey-local-dev/pids/dev-org-id.txt after ./local-dev.sh start
NEXT_PUBLIC_AUTH_PROXY_CONFIG_ID00000000-0000-4000-8000-0000000000b1 (fixed dev proxy ID)
Run ./local-dev.sh start-docs and open https://docs.0xkey.com (or http://localhost:3300) while iterating on docs.

Optional configuration

Passkeys

const client = new ZeroXKeyClient({
  organizationId: "...",
  authProxyConfigId: "...",
  passkeyConfig: {
    rpId: "app.0xkey.com", // required for React Native; web defaults to hostname
    timeout: 60000,
    userVerification: "preferred",
  },
});

await client.init();
For local passkey testing, serve your app at https://app.0xkey.com via local-gateway so rpId matches the page origin.

External browser wallets

const client = new ZeroXKeyClient({
  organizationId: "...",
  authProxyConfigId: "...",
  walletConfig: {
    features: { auth: true, connecting: true },
    chains: {
      ethereum: { native: true },
      solana: { native: true },
    },
  },
});

await client.init();

Making authenticated requests

After init(), use createHttpClient() for API calls. The client picks the active stamper (IndexedDB session, passkey, or wallet) based on login state.
const http = client.createHttpClient();
const wallets = await http.getWallets({ organizationId: client.config.organizationId });
For OTP flows that need a backend, pair the browser client with @0xkey-io/sdk-server server actions (server.sendOtp, server.verifyOtp) or your own API routes.

Next steps

React Wallet Kit

Fastest Embedded Wallet path for React / Next.js

TypeScript server SDK

API key stamping, proxies, and OTP helpers

Chain adapters

viem, ethers, Solana, and EIP-1193

Code examples

oauth, kitchen-sink, with-viem, delegated-access