Registry / http-networking / kinto-http

kinto-http

JSON →
library11.11.0jsnpmunverified

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.

npm install kinto-http
INSTALL
IMPORT
SIG · KINTO-HTTP
K
kinto-http
http-networkingjavascriptv11.11.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KintoClient
import { KintoClient } from 'kinto-http'
import KintoClient from 'kinto-http'
Default export not available; named import only.
Bucket
import { Bucket } from 'kinto-http'
High-level Bucket class for bucket operations.
Collection
import { Collection } from 'kinto-http'
High-level Collection class for collection operations.
SUPPORTED_PROTOCOL_VERSION
import { SUPPORTED_PROTOCOL_VERSION } from 'kinto-http'
const SUPPORTED_PROTOCOL_VERSION = require('kinto-http').SUPPORTED_PROTOCOL_VERSION
Exported constant; available as named export since v5.
KintoClient (CommonJS)
const { KintoClient } = require('kinto-http')
const KintoClient = require('kinto-http')
CJS users must destructure named exports.

Shows how to initialize a Kinto client, create a bucket/collection, and perform CRUD operations.

import { KintoClient } from 'kinto-http'; const client = new KintoClient('https://kinto.dev.mozaws.net/v1', { headers: { Authorization: 'Basic ' + btoa('user:pass') } }); async function main() { const serverInfo = await client.fetchServerInfo(); console.log('Server:', serverInfo); const bucket = client.bucket('default'); const collection = bucket.collection('tasks'); // Create a record const { data } = await collection.createRecord({ title: 'Buy milk', done: false }); console.log('Created record:', data.id); // List records const { data: records } = await collection.listRecords(); console.log('Records:', records); // Update await collection.updateRecord({ ...data, title: 'Buy almond milk' }); // Delete await collection.deleteRecord(data.id); } main().catch(console.error);
Debug
Known issues
breakingFull rewrite in TypeScript; EventEmitter replaced with interface and made optional.
fix
Refer to v5 migration guide: replace EventEmitter usage with custom event interface or omit.
affects: >=5.0.0
breakingRemoved support for Total-Records header on GET; use listRecords with totalRecords? instead.
fix
Use options such as { query: { _limit: someNumber } } to control pagination.
affects: >=4.7.0
deprecatedBasic authentication via `Authorization: Basic ...` header with atob/btoa deprecated; prefer OAuth Bearer tokens.
fix
Use headers: { Authorization: 'Bearer <token>' } instead.
affects: >=5.0.0
gotchaPeer dependencies (node-fetch, form-data, atob) must be installed manually; not included automatically.
fix
Run: npm install node-fetch form-data atob
affects: >=5.0.0
gotchaIn browsers, native fetch is used; node-fetch is not required but may be polyfilled if used in test environments.
fix
Ensure node-fetch is installed only for Node.js; no need in browser.
affects: >=5.0.0
gotchaThe safe option (safe: true) for create/update/delete operations may fail if the server does not support ETags properly; handle errors gracefully.
fix
Wrap operations in try-catch and check error types.
affects: >=4.0.0
Errors
Common errors & fixes
Cannot find module 'node-fetch'
Peer dependency missing; node-fetch is required for Node.js but not installed automatically.
fix
npm install node-fetch
TypeError: client.fetchServerInfo is not a function
Using a constructor that returns a deprecated version of the client or using an old import pattern.
fix
Ensure you are using named import: import { KintoClient } from 'kinto-http' and instantiate with new KintoClient(...).
Uncaught ReferenceError: atob is not defined
atob is not available in Node.js; atob peer dependency is missing.
fix
npm install atob
Error: Invalid version: 'v1'
The API version is specified incorrectly; Kinto expects a version segment in the URL (e.g., /v1).
fix
Ensure the server URL ends with '/v1' or the correct API version.
Upgrade
Version history
11.11.0latest on npm
Audit
Dependencies
node-fetchrequiredHTTP requests in Node.js (browser uses native fetch)
form-datarequiredMultipart form data for attachment uploads
atobrequiredBase64 decoding (btoa/atob polyfill for Node.js)
Agent activity
2 hits · last 30 days
node
2
Resources