Official SDK

Node.js / TypeScript SDK

The official TypeScript client: fully typed resources, async pagination, retries and ETag-aware conditional requests. Published on npm and generated from the API contract.

Install

Requires Node.js 18+. Published on npm, currently 0.13.0.

npm install @buun_group/gunspec-sdk

Your first call

The client reads your key from the environment. Responses are typed, so the fields below complete in an editor.

import { GunSpec } from '@buun_group/gunspec-sdk' const client = new GunSpec({ apiKey: process.env.GUNSPEC_API_KEY }) const { data } = await client.firearms.get('glock-g17') console.log(data.name, data.barrelLengthMm)

Paging

Both clients walk pages for you and stop on a short page, which works on every plan.

for await (const firearm of client.firearms.listAutoPaging({ category: 'rifle' })) { console.log(firearm.name) }

Why it matters: A hand-written loop that tests against the total reads exactly one page on Explorer, because that plan is not told the total.

Everything else

Retries, conditional requests, error handling and every resource method are in the SDK reference, which is generated from the client itself.

SDK reference · View on npm

Back to Assets