@0bit/gate
v0.1.4
Published
Official 0Gate SDK — Node server, browser embed, and React components. Stripe-style ergonomics for ramps.
Readme
@0bit/gate
Unified official SDK for the 0Gate ramp API — Node server, browser embed, React components, and Python.
Renamed from
@0bit/0gate(npm) /0bit-0gate(PyPI). Install the new names below.
Install
| Surface | Command |
|---------|---------|
| Node (server) | npm install @0bit/gate |
| Browser (bundler) | npm install @0bit/gate → import { GateRamp } from '@0bit/gate/browser' |
| React | npm install @0bit/gate → import { RampCheckout } from '@0bit/gate/react' |
| Python | pip install 0bit-gate → from zerobit.gate import GateClient |
Python framework extras
pip install "0bit-gate[django]"
pip install "0bit-gate[fastapi]"
pip install "0bit-gate[flask]"Quick start — Node
import { GateClient } from '@0bit/gate';
const client = new GateClient({ apiKey: process.env.GATE_KEY! });
const session = await client.sessions.create({
amount: '100.00',
currency: 'EUR',
return_url: 'https://myapp.example/done',
});
console.log(session.client_secret);Quick start — Browser
import { GateRamp } from '@0bit/gate/browser';
const ramp = new GateRamp({
publishableKey: 'pk_test_...',
clientSecret: session.client_secret,
});
await ramp.mount('#gate-container');CDN (IIFE):
<script src="https://cdn.jsdelivr.net/npm/@0bit/gate/dist/browser/0gate.iife.js"></script>
<script>
const ramp = new GateJS.GateRamp({ publishableKey: 'pk_test_...', clientSecret: 'gsec_...' });
ramp.mount('#container');
</script>Quick start — React
import { RampCheckout } from '@0bit/gate/react';
<RampCheckout
publishableKey={import.meta.env.VITE_GATE_KEY}
clientSecret={session.client_secret}
onSuccess={({ txId }) => router.push('/done')}
/>Quick start — Python
from zerobit.gate import GateClient
client = GateClient(api_key="sk_test_...")
session = client.sessions.create({
"amount": "100.00",
"currency": "EUR",
"return_url": "https://myapp.example/done",
})
print(session["client_secret"])SDK naming policy
| Surface | 0Gate | Future products |
|---------|-------|-----------------|
| npm | @0bit/gate | @0bit/0pools, @0bit/0base |
| PyPI | 0bit-gate | 0bit-0pools, 0bit-0base |
| Python import | zerobit.gate | zerobit.pools, zerobit.base |
Development
cd 0Bit_apps/0Gate/0Gate_Sdk
npm ci && npm run build && npm test
pip install -e ".[dev,django,fastapi,flask]"
pytestLicense
MIT. Part of the 0Bit / 0Gate ramp platform.
