> ## 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.

# Getting started with @0xkey-io/core

> Set up @0xkey-io/core in a frontend app: organization, Auth Proxy, installation, and ZeroXKeyClient initialization.

## Organization setup

Create a 0xkey organization in the [Dashboard](https://app.0xkey.io) (or use the local stack via `./local-dev.sh start`). Follow [Account setup](/getting-started/quickstart) 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.

<Steps>
  <Step title="Enable Auth Proxy">
    Turn on **Auth Proxy** and choose auth methods (for example **Email OTP** and **Passkeys**).
  </Step>

  <Step title="Copy IDs">
    Save **Organization ID** and **Auth Proxy config ID** for your app config.
  </Step>
</Steps>

See [Auth Proxy](/reference/auth-proxy) for endpoint details and allowed-origins configuration.

***

## Installation

<CodeGroup>
  ```bash npm theme={"theme":{"light":"github-light","dark":"github-dark"}}
  npm install @0xkey-io/core
  ```

  ```bash pnpm theme={"theme":{"light":"github-light","dark":"github-dark"}}
  pnpm add @0xkey-io/core
  ```

  ```bash yarn theme={"theme":{"light":"github-light","dark":"github-dark"}}
  yarn add @0xkey-io/core
  ```
</CodeGroup>

<Note>
  Using **React**? Prefer [`@0xkey-io/react-wallet-kit`](/sdks/react/getting-started) — it wraps `@0xkey-io/core` with UI, hooks, and Auth Proxy defaults.
</Note>

***

## Client initialization

Unlike React Wallet Kit, `@0xkey-io/core` has no provider or hooks. You work directly with `ZeroXKeyClient`.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
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/roadmap) (`*.0xkey.com` in `/etc/hosts`):

| Variable                           | Local value                                                                  |
| :--------------------------------- | :--------------------------------------------------------------------------- |
| `NEXT_PUBLIC_BASE_URL`             | `https://api.0xkey.com`                                                      |
| `NEXT_PUBLIC_AUTH_PROXY_URL`       | `https://authproxy.0xkey.com`                                                |
| `NEXT_PUBLIC_ORGANIZATION_ID`      | From `/tmp/0xkey-local-dev/pids/dev-org-id.txt` after `./local-dev.sh start` |
| `NEXT_PUBLIC_AUTH_PROXY_CONFIG_ID` | `00000000-0000-4000-8000-0000000000b1` (fixed dev proxy ID)                  |

Run `./local-dev.sh start-docs` and open **[https://docs.0xkey.com](https://docs.0xkey.com)** (or `http://localhost:3300`) while iterating on docs.

***

## Optional configuration

### Passkeys

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
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

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
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`](/sdks/javascript-server) server actions (`server.sendOtp`, `server.verifyOtp`) or your own API routes.

***

## Next steps

<CardGroup cols={2}>
  <Card title="React Wallet Kit" icon="react" href="/sdks/react/getting-started">
    Fastest Embedded Wallet path for React / Next.js
  </Card>

  <Card title="TypeScript server SDK" icon="server" href="/sdks/javascript-server">
    API key stamping, proxies, and OTP helpers
  </Card>

  <Card title="Chain adapters" icon="link" href="/sdks/typescript-frontend/landing#chain-and-dapp-adapters">
    viem, ethers, Solana, and EIP-1193
  </Card>

  <Card title="Code examples" icon="github" href="https://github.com/0xkey-io/sdk-js/tree/main/examples">
    oauth, kitchen-sink, with-viem, delegated-access
  </Card>
</CardGroup>
