Installation
Install the 0Bit packages, choose SDK versus REST, and set up the first development environment.
You can integrate with 0Bit through SDKs or direct HTTPS calls. The install path depends on the product surface. Use SDKs when an official package exists for the workflow you are building; use REST when the product API reference is the source of truth or when your organization has product-gated access.
The canonical public SDK package in the current codebase is 0Gate. Other products may be REST-first, entitlement-gated, or reviewed before SDK use:
| Product or surface | Package/API path | Use |
|---|---|---|
| 0Gate Node server | @0bit/gate | Create sessions and call 0Gate server APIs from your backend. |
| 0Gate browser bundler | @0bit/gate/browser | Mount the hosted 0Gate experience with a publishable key and client_secret. |
| 0Gate React | @0bit/gate/react | Render a React wrapper around the same hosted 0Gate flow. |
| 0Gate Python | 0bit-gate / zerobit.gate | Create sessions from Python services. |
| 0Pools | REST/API reference where approved | Discover entitled pools, create quotes, execute quotes, and read trade status. |
| 0Base | REST/API reference where enabled | Create checkout/payment objects, payment links, invoices, reports, and ledger reads. |
| 0Link | REST/API reference where enabled | Review route/workflow state, fallback boundaries, and settlement-handling records. |
| 0Pools Scan | Public-safe reads | Query indexed activity and explorer/status records. |
Install the product you are integrating
The 0Gate SDK is the right first package for hosted buy, sell, swap, and checkout-style flows. 0Pools, 0Base, and 0Link docs explain product concepts and API boundaries, but access and SDK availability depend on your entitlement and product status.
Node and browser
npm install @0bit/gateServer usage:
import { GateClient } from '@0bit/gate';
const gate = new GateClient({
apiKey: process.env.OBIT_SECRET_KEY!,
baseUrl: 'https://gate-api-sandbox.0bit.app',
});
const session = await gate.sessions.create({
amount: '100.00',
currency: 'EUR',
return_url: 'https://app.partner.example/checkout/done',
});Browser usage:
import { GateRamp } from '@0bit/gate/browser';
const ramp = new GateRamp({
publishableKey: process.env.NEXT_PUBLIC_OBIT_PUBLISHABLE_KEY!,
clientSecret: session.client_secret,
environment: 'sandbox',
});
await ramp.mount('#gate-container');The SDK constructor uses the API origin, while raw REST examples include /v1 in the URL. Keep that distinction clear:
| Method | Example |
|---|---|
| SDK base URL | https://gate-api-sandbox.0bit.app |
| REST base URL | https://gate-api-sandbox.0bit.app/v1 |
React
import { RampCheckout } from '@0bit/gate/react';
export function CheckoutGate({ clientSecret }: { clientSecret: string }) {
return (
<RampCheckout
publishableKey={process.env.NEXT_PUBLIC_OBIT_PUBLISHABLE_KEY!}
clientSecret={clientSecret}
onSuccess={({ txId }) => {
console.log('UX callback only', txId);
}}
/>
);
}React callbacks are still browser callbacks. Use them to update the screen, not to mark an order paid.
Python
pip install 0bit-gateFramework extras are available when you want adapter helpers:
pip install "0bit-gate[fastapi]"
pip install "0bit-gate[flask]"
pip install "0bit-gate[django]"Python usage:
import os
from zerobit.gate import GateClient
client = GateClient(
api_key=os.environ["OBIT_SECRET_KEY"],
base_url="https://gate-api-sandbox.0bit.app",
)
session = client.sessions.create({
"amount": "100.00",
"currency": "EUR",
"return_url": "https://app.partner.example/checkout/done",
})
print(session["client_secret"])Direct REST
SDKs are optional. This is the same create-session call over HTTPS:
curl -X POST "$OBIT_GATE_API_BASE_URL/gate_sessions" \
-H "Authorization: Bearer $OBIT_SECRET_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order_123_create_gate_session" \
-d '{
"amount": "100.00",
"currency": "EUR",
"return_url": "https://app.partner.example/checkout/done"
}'Use REST for 0Pools, 0Base, or 0Link when the API reference is the source of truth for fields and status codes. Product docs explain what to build and why; API reference pages define exact request/response schemas.
Product install decision
| If you are starting with... | Install/call | Continue to |
|---|---|---|
| Hosted buy, sell, swap, checkout, redirect, WebView, or widget | @0bit/gate or 0bit-gate | 0Gate quickstart |
| Headless liquidity, entitled pools, quote execution, or trade status | REST against the approved Pools API | 0Pools quickstart |
| Merchant checkout/payment objects, reports, payment links, or invoices | Product documentation for enabled 0Base workflows | 0Base quickstart |
| Route review, fallback behavior, quote availability, or connected workflow state | Product documentation for 0Link routing review | 0Link quickstart |
| Explorer/status/search visibility | Scan docs and public-safe reads | 0Pools Scan |
Local project checklist
| Step | Check |
|---|---|
| Install package or choose REST | 0Gate SDK installed, or product API reference selected for 0Pools/0Base/0Link/Scan. |
| Configure env | Product API base URL, sk_test_* or approved credential, browser-safe key where applicable, and webhook secret where events are used. |
| Server route | Your backend creates the 0Bit object and stores the returned id. |
| Browser route | Your frontend receives only browser-safe values. |
| Webhook route | Raw request body is available for signature verification. |
| Logging | Your logs include your reference id, 0Bit object id, request id where available, and event id. |