Every request is GET /users/1: method and path in one string, relative to an optional base URL.
Grab data with METHOD /path. Tuple results. JSON:API by default; plain JSON when you opt out.
Every request is GET /users/1: method and path in one string, relative to an optional base URL.
const [data, error, meta] = await grab(...). Narrow with if (error); failures are returned, not thrown.
Denormalised data, relationship merging, and write envelopes. Use format: 'json' for GitHub-style APIs.
pnpm add grabkitimport grabkit from 'grabkit';
const grab = grabkit('https://api.example.com', { casing: 'camelCase' });const [data, error, meta] = await grab('GET /users/1');
if (error) { console.error(error.message, error.statusCode); return;}
console.log(data.name, meta.statusCode);