Skip to main content

Install

Or install from local build (e.g. for development):

Requirements

  • Node.js >= 18 (native fetch, crypto)
  • TypeScript >= 4.5 (optional)

Quick start

API overview

Options use camelCase (e.g. pageSize, verifiedBy); the client converts to API snake_case.

Usage details

Pagination and filters

Verify result and error_code

Aside from 4xx/5xx (which throw CodeGateApiError), verify uses success and error_code:

Error handling

4xx/5xx throw CodeGateApiError with status and detail:

Retry and resilience

Retry a limited number of times on 5xx or network errors:

Custom requests and generateSignature

For your own HTTP client, use generateSignature:

Environment variables

Use env vars for credentials in different environments:

Development

Build

Output in dist/: index.js (ESM), index.cjs, index.d.ts.

Tests

Examples

Set CODEGATE_API_KEY, CODEGATE_SECRET, CODEGATE_PROJECT_ID, CODEGATE_BASE_URL (optional).