Registry / devops / svix-fetch

svix-fetch

JSON →
library4.0.0jsnpmunverified

svix-fetch (v4.0.0) is a fork of isomorphic-fetch that adds HTTP keep-alive support in Node.js. It is an isomorphic WHATWG Fetch API polyfill for Node.js and browserify. The package is maintained by Svix for internal use and published publicly. It requires explicit installation of the `fetch` polyfill and is only suitable for projects needing the specific keepalive behavior; otherwise, alternatives like isomorphic-fetch or cross-fetch are recommended. Maintenance is minimal.

npm install svix-fetch
INSTALL
IMPORT
SIG · SVIX-FETCH
S
svix-fetch
devopsjavascriptv4.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

svix-fetch
require('svix-fetch')
import 'svix-fetch'
This package does not export anything; calling require() for its side effects (polyfills global fetch). ESM import may not work as intended; use require for reliable side-effect loading.
fetch
fetch('url')
import fetch from 'svix-fetch'
The package polyfills global fetch, so you call fetch directly after require. It does not export a fetch function.

Demonstrates requiring svix-fetch (polyfills global fetch) and using fetch to make a GET request and process JSON response.

require('svix-fetch'); fetch('https://httpbin.org/get') .then(function(response) { if (!response.ok) { throw new Error('Bad response'); } return response.json(); }) .then(function(data) { console.log(data); }) .catch(function(err) { console.error(err); });
Debug
Known issues
gotchaThe package does not export any symbols; it must be required for side effects only.
fix
Use `require('svix-fetch')` without assigning to a variable.
affects: >=0.0.0
gotchaEnsure that a Promise polyfill is available (e.g., es6-promise) for older Node versions.
fix
Install and require a Promise polyfill before requiring svix-fetch.
affects: <4.0.0
Errors
Common errors & fixes
fetch is not defined
The package was not required or not properly installed.
fix
Add `require('svix-fetch');` at the top of your entry file.
Cannot find module 'svix-fetch'
Package not installed.
fix
Run `npm install svix-fetch`.
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
svix-fetch — npm install svix-fetch · libregistry