network/examples/sdk-typescript
anonpenguin 3fe78ee62a Add OpenAPI spec and SDK authoring guide with TypeScript example
- Add machine-readable OpenAPI spec for Storage, Database, PubSub -
Document HTTP endpoints, auth, migrations, and SDK patterns - Provide
minimal TypeScript SDK example and code - Update README and add example
SDK files and configs - Bump version to 0.40.0-beta
2025-08-23 12:10:54 +03:00
..

DeBros Gateway TypeScript SDK (Minimal Example)

Minimal, dependency-light wrapper around the HTTP Gateway.

Usage:

npm i
export GATEWAY_BASE_URL=http://127.0.0.1:8080
export GATEWAY_API_KEY=your_api_key
import { GatewayClient } from './src/client';

const c = new GatewayClient(process.env.GATEWAY_BASE_URL!, process.env.GATEWAY_API_KEY!);
await c.createTable('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)');
await c.transaction([
  'INSERT INTO users (id,name) VALUES (1,\'Alice\')'
]);
const res = await c.query('SELECT name FROM users WHERE id = ?', [1]);
console.log(res.rows);