A lightweight, isomorphic Hydra client built on the Fetch API for consuming Hydra-powered hypermedia APIs. Current stable version 0.2.0 is in early development with monthly releases. It differentiates by being promise-based, supporting both Node.js and browser environments, and offering a simple interface to retrieve resources, follow links, and execute operations defined by Hydra vocabularies. It is designed for developers building clients for Hydra-enabled APIs without heavy dependencies.
npm install hydra-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a Hydra client, load an entry point, fetch a resource, and invoke operations using hydra-fetch.
Update Hydra constructor call to include { baseUrl: 'your-base-url' }.In Node.js <18, provide a fetch polyfill (e.g., cross-fetch) via the constructor option.
Replace `hydra.fetchResource(url)` with `hydra.load(url)`.
Ensure baseUrl is set in the Hydra constructor and use absolute URLs or paths relative to baseUrl.
Provide a fetch polyfill, e.g., install cross-fetch and pass { fetch: require('cross-fetch') } (or use global fetch in Node 18+).