🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@gmode/client

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gmode/client

Typed fetch client runtime for GMode gateways — pairs with `gmode generate client`.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

@gmode/client

Lightweight typed fetch runtime for generated OpenAPI clients.

gmode generate client emits a self-contained gmode-client.ts that imports nothing at runtime except the platform fetch. This package provides the shared patterns and error types used by the generator.

Generated usage

gmode generate client --url http://localhost:8787/openapi.json --out ./generated
import { createClient } from "./generated/gmode-client";

const api = createClient({ baseUrl: "https://api.example.com" });
const user = await api.getUser({ params: { id: "u_1" } });

Errors

Failed responses throw ApiClientError with status, code, and parsed body:

try {
  await api.getUser({ params: { id: "missing" } });
} catch (err) {
  if (err instanceof ApiClientError) {
    console.log(err.status, err.body);
  }
}

See packages/cli/src/codegen/openapi-client.ts for the generator.

FAQs

Package last updated on 09 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts