@codeserk/forge-api-internal
v0.1.0
Published
Authenticated client for the Forge internal API. Handles PAT auth and HMAC signing.
Downloads
148
Readme
@codeserk/forge-api-internal
Authenticated TypeScript client for the Forge internal API. Use this from scripts, the MCP server, or any code that needs to read or mutate Forge data on behalf of a user.
Install
npm install @codeserk/forge-api-internalUsage
Get a SDK key from the dashboard (Settings → Account → Personal access tokens → New token). The key is shown once and never again. Paste it into your env:
import { ForgeInternalClient } from '@codeserk/forge-api-internal'
const client = new ForgeInternalClient({
baseUrl: 'https://api-internal.forge.codeserk.es',
sdkKey: process.env.FORGE_SDK_KEY!,
})
const me = await client.auth.getCurrentUser()
const orgs = await client.organizations.getUserOrganizations()The client handles PAT bearer auth and HMAC signing transparently — every request is signed with the per-PAT signing secret derived from the SDK key.
Scopes
Each PAT has one or more scopes: read, create, update, delete. The server enforces them based on the HTTP verb:
GET→readPOST→createPUT/PATCH→updateDELETE→delete
A read-only token can list but not mutate.
