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
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):
Example OTP initiation:
@0xkey-io/core or @0xkey-io/react-wallet-kit on the client for session stamping. See Email authentication and Backend setup.