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.
Overview
@0xkey-io/sdk-server signs requests to the 0xkey API with your organization’s API keypair. Use it for:
- Backend automation (wallets, policies, users)
- Proxies that sign specific user-initiated activities with the parent org key (sub-org creation, email auth, OTP)
- Next.js Server Actions exported as
server.*helpers
@0xkey-io/http for lower-level typed requests.
Company Wallets and delegated access backends typically use this package (or the Go SDK). Embedded Wallets in React should still use React Wallet Kit on the client; use
sdk-server only where you need a trusted backend.Installation
Initializing
Root organization ID for requests unless overridden per call.
Public API base URL. Use
https://api.0xkey.com with local-gateway during dev.API private key (never expose to the browser).
API public key registered in the Dashboard for the private key above.
Creating clients
API calls must be stamped. With the server SDK, stamping uses your API keypair.apiClient()
Returns a typed client that signs every request with the configured API credentials.
examples/with-sdk-server.
API proxies
Some user flows must be signed by the parent organization (for examplecreateSubOrganization, emailAuth, initOtp). You can implement routes yourself with apiClient(), or use built-in proxy handlers.
Default allowed proxy methods:
oauth, createReadWriteSession, createSubOrganization, emailAuth, initUserEmailRecovery
Express
Next.js Pages Router
allowedMethods to the smallest set your frontend needs.
Server Actions (server.*)
The package exports helpers for common auth flows (usable from Next.js "use server" modules or your own backend):
| Helper | Purpose |
|---|---|
server.sendOtp | Start email or SMS OTP |
server.verifyOtp | Verify OTP code |
server.otpLogin | Complete OTP login with client public key |
server.oauthLogin | Complete OAuth with OIDC token |
server.sendCredential | Email magic-link / credential delivery |
server.createSuborg | Create sub-organization |
server.getOrCreateSuborg | Idempotent sub-org lookup / create |
server.getSuborgs / server.getVerifiedSuborgs | List sub-orgs by filter |
server.getUsers | List users in an organization |
server.createOauthProviders | Register OAuth provider metadata |
@0xkey-io/core or @0xkey-io/react-wallet-kit on the client for session stamping. See Email authentication and Backend setup.
Related packages
| Package | When to use |
|---|---|
@0xkey-io/core | Browser / custom UI clients |
@0xkey-io/http | Manual stamping without the ZeroXKey facade |
@0xkey-io/api-key-stamper | Standalone P-256 request stamps |
| Go SDK | Non-Node backends |
Examples
| Example | Description |
|---|---|
with-sdk-server | Minimal Whoami via API key |
delegated-access | Scoped backend signing |
otp-auth | Email OTP with/without backend |
oauth | OAuth login flow |