GebSecure Docs v0.1.0

Reference · SDKs

SDKs

The five official SDKs — TypeScript, Python, Go, Java and .NET — with identical behaviour defined by one conformance suite.

Language Package Install Runtime Client
TypeScript / JavaScript @gebsecure01/sdk (npm) npm install @gebsecure01/sdk Node.js ≥ 20, Deno, Bun, Workers (fetch + WebCrypto) GebSecure
Python gebsecure (PyPI) pip install gebsecure Python ≥ 3.9 GebSecure, AsyncGebSecure
Go github.com/gebsecure/gebsecure-go go get github.com/gebsecure/gebsecure-go Go ≥ 1.21, standard library only Client
Java com.gebsecure:gebsecure-sdk (Maven Central) Maven / Gradle Java ≥ 11, Jackson GebSecureClient
.NET GebSecure (NuGet) dotnet add package GebSecure .NET 8, .NET Standard 2.0 GebSecureClient

All five are at version 0.2.1 and target API v1. Each SDK reference page lists every public client method, extracted from the SDK's source when this site is built, with the HTTP operation it calls.

Shared behaviour#

The SDKs implement one specification, sdks/conformance/README.md, and every SDK's test suite replays the same JSON request/response fixtures:

  • Authentication — API keys, client secrets, private_key_jwt (Ed25519 / ES256 / RS256) and RFC 8693 delegation exchange. Tokens are cached and refreshed min(60 s, expires_in/2) before expiry; concurrent callers share one token request; a 401 with a cached token triggers one re-authentication. Session auth for CLIs and CI: login (refresh token in the body), refreshSession, logout, me.
  • Configuration from the environment — GEBSECURE_GATEWAY_URL, GEBSECURE_API_URL, and GEBSECURE_API_KEY or GEBSECURE_CLIENT_SECRET. Defaults: https://gateway.gebsecure.com and https://api.gebsecure.com.
  • Retries — 3 retries after the first attempt, equal-jitter exponential backoff from 500 ms to 8 s, Retry-After honoured up to 60 s, 30 s per attempt. 429 is always retried; 502/503/504, network errors and timeouts only for idempotent requests (GET/PUT/DELETE except saving a policy version, token requests, dry runs, span reports, evaluation-only calls, cancellations, and execute with an idempotency key). execute generates an idempotency key (sdk-<uuid>) when retries are enabled; refreshSession is never retried except on 429. Passing a per-call idempotency key sends Idempotency-Key and marks a POST/PATCH as safe to retry.
  • Errors — typed errors mapped from RFC 9457 problem+json with status, code, detail, requestId, traceId and details; DENY and APPROVAL_REQUIRED are results, not errors.
  • Results — execute returns an ExecuteResult for every runtime outcome (including denied and failed); a deploy blocked by tests or conflicts (HTTP 412) is returned with deployed: false.
  • Tracing — every call sends a W3C traceparent; pass your own to join a trace; buildSpan/reportSpans report the agent's own spans.
  • Forward compatibility — unknown response fields and enum values are tolerated, so older SDKs keep working against newer servers.

Models are generated from the OpenAPI documents and sdks/spec/overlay.json by node sdks/scripts/generate-models.mjs (see API models). Versioning and compatibility: SDK 0.1 → 0.2 migration and API versioning.

Note

From SDK 0.2.1, executeWithApproval (all SDKs) waits for the approval and then follows the execution the worker resumes; it never re-executes. 0.2.0 raced the worker — see Approvals.