Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

ketting

Package Overview
Dependencies
Maintainers
2
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ketting

Opiniated HATEAOS / Rest client.

latest
Source
npmnpm
Version
8.0.3
Version published
Weekly downloads
991
-36.8%
Maintainers
2
Weekly downloads
 
Created
Source

Logo Ketting - The HATEOAS client for javascript

Check out the Wiki for full documentation.

Introduction

The Ketting library is a generic REST client with Hypermedia features.

The library will work with any JSON-based HTTP API, but it gets superpowers when using it with formats that have support for links, including:

And it even works with HTML links, and HTTP Link Headers.

Ketting is designed to both work in the browser and in Node.js. Additionally, it has react bindings that will make it work in a way that's familiar to Apollo-Client users.

Example

const ketting = new Ketting('https://api.example.org/');

// Follow a link with rel="author". This could be a HTML5 `<link>`, a
// HAL `_links` or a HTTP `Link:`.
const author = await ketting.follow('author');

// Grab the current state
const authorState = await author.get();

// Change the firstName property of the object. Note that this assumes JSON.
authorState.data.firstName = 'Evert';

// Save the new state
await author.put(authorState);

Docs

Notable Features

Ketting is a library that sits on top of Fetch API to provide a RESTful interface and make it easier to follow REST best practices more strictly.

It provides some useful abstractions that make it easier to work with true hypermedia / HATEOAS servers. It currently parses many hypermedia formats and has a deep understanding of links and embedded resources. There's also support for parsing and following links from HTML documents, and it understands the HTTP Link: header.

It also has support for 'fetch middlewares', which is used to implement OAuth2 support, but also opens the door to development of other plugins.

Using this library it becomes very easy to follow links from a single bookmark, and discover resources and features on the server.

Read further on the Wiki

Keywords

rest

FAQs

Package last updated on 03 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts