{"id":18463,"library":"kinto-http","title":"Kinto HTTP Client","description":"JavaScript HTTP client for the Kinto API (current stable version 5.3.0). Maintained by the Kinto team, with releases on a monthly cadence. Full rewrite in TypeScript since v5.0.0. Supports Node.js >=10 and modern browsers. Key differentiators: provides both high-level bucket/collection classes and lower-level batch/pagination utilities; offers pluggable fetch and event systems; ships TypeScript definitions and supports CommonJS and ESM. Requires peer dependencies node-fetch, form-data, and atob.","status":"active","version":"5.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/Kinto/kinto-http.js","tags":["javascript","kinto","http","client","api","typescript"],"install":[{"cmd":"npm install kinto-http","lang":"bash","label":"npm"},{"cmd":"yarn add kinto-http","lang":"bash","label":"yarn"},{"cmd":"pnpm add kinto-http","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP requests in Node.js (browser uses native fetch)","package":"node-fetch","optional":false},{"reason":"Multipart form data for attachment uploads","package":"form-data","optional":false},{"reason":"Base64 decoding (btoa/atob polyfill for Node.js)","package":"atob","optional":false}],"imports":[{"note":"Default export not available; named import only.","wrong":"import KintoClient from 'kinto-http'","symbol":"KintoClient","correct":"import { KintoClient } from 'kinto-http'"},{"note":"High-level Bucket class for bucket operations.","symbol":"Bucket","correct":"import { Bucket } from 'kinto-http'"},{"note":"High-level Collection class for collection operations.","symbol":"Collection","correct":"import { Collection } from 'kinto-http'"},{"note":"Exported constant; available as named export since v5.","wrong":"const SUPPORTED_PROTOCOL_VERSION = require('kinto-http').SUPPORTED_PROTOCOL_VERSION","symbol":"SUPPORTED_PROTOCOL_VERSION","correct":"import { SUPPORTED_PROTOCOL_VERSION } from 'kinto-http'"},{"note":"CJS users must destructure named exports.","wrong":"const KintoClient = require('kinto-http')","symbol":"KintoClient (CommonJS)","correct":"const { KintoClient } = require('kinto-http')"}],"quickstart":{"code":"import { KintoClient } from 'kinto-http';\n\nconst client = new KintoClient('https://kinto.dev.mozaws.net/v1', {\n  headers: { Authorization: 'Basic ' + btoa('user:pass') }\n});\n\nasync function main() {\n  const serverInfo = await client.fetchServerInfo();\n  console.log('Server:', serverInfo);\n\n  const bucket = client.bucket('default');\n  const collection = bucket.collection('tasks');\n\n  // Create a record\n  const { data } = await collection.createRecord({ title: 'Buy milk', done: false });\n  console.log('Created record:', data.id);\n\n  // List records\n  const { data: records } = await collection.listRecords();\n  console.log('Records:', records);\n\n  // Update\n  await collection.updateRecord({ ...data, title: 'Buy almond milk' });\n\n  // Delete\n  await collection.deleteRecord(data.id);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Shows how to initialize a Kinto client, create a bucket/collection, and perform CRUD operations."},"warnings":[{"fix":"Refer to v5 migration guide: replace EventEmitter usage with custom event interface or omit.","message":"Full rewrite in TypeScript; EventEmitter replaced with interface and made optional.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use options such as { query: { _limit: someNumber } } to control pagination.","message":"Removed support for Total-Records header on GET; use listRecords with totalRecords? instead.","severity":"breaking","affected_versions":">=4.7.0"},{"fix":"Use headers: { Authorization: 'Bearer <token>' } instead.","message":"Basic authentication via `Authorization: Basic ...` header with atob/btoa deprecated; prefer OAuth Bearer tokens.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Run: npm install node-fetch form-data atob","message":"Peer dependencies (node-fetch, form-data, atob) must be installed manually; not included automatically.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Ensure node-fetch is installed only for Node.js; no need in browser.","message":"In browsers, native fetch is used; node-fetch is not required but may be polyfilled if used in test environments.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Wrap operations in try-catch and check error types.","message":"The safe option (safe: true) for create/update/delete operations may fail if the server does not support ETags properly; handle errors gracefully.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install node-fetch","cause":"Peer dependency missing; node-fetch is required for Node.js but not installed automatically.","error":"Cannot find module 'node-fetch'"},{"fix":"Ensure you are using named import: import { KintoClient } from 'kinto-http' and instantiate with new KintoClient(...).","cause":"Using a constructor that returns a deprecated version of the client or using an old import pattern.","error":"TypeError: client.fetchServerInfo is not a function"},{"fix":"npm install atob","cause":"atob is not available in Node.js; atob peer dependency is missing.","error":"Uncaught ReferenceError: atob is not defined"},{"fix":"Ensure the server URL ends with '/v1' or the correct API version.","cause":"The API version is specified incorrectly; Kinto expects a version segment in the URL (e.g., /v1).","error":"Error: Invalid version: 'v1'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}