🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

hypothesis-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hypothesis-api

A library for easily working with the Hypothes.is API.

latest
Source
npmnpm
Version
0.5.2
Version published
Maintainers
1
Created
Source

Hypothesis node API

A node wrapper for the hypothesis api.

Install

npm install hypothesis-api

Documentation

See the h documentation page for more info on request bodys, query params, etc.

Usage

const HypothesisAPI = require('./hypothesis.js');

// To use: Construct new instance with APIKEY
// Get one here: https://hypothes.is/account/developer
const h = new HypothesisAPI('PASTE_YOUR_APIKEY_HERE');

// Example search.
// See query params: https://h.readthedocs.io/en/latest/api/#operation/search

h.search({
    group: 'aRBDqnWx',
    limit:200
}).then((data)=> {
    console.log(data);
});

// Get an annotation by id
h.getAnnotation('xV_csDKHEee9BQMw6s02xQ').then((data)=> {
    console.log(data);
});

// Delete an annotation by id
h.deleteAnnotation('xV_csDKHEee9BQMw6s02xQ').then((data)=> {
    console.log(data);
});

// Patch an annotation by id
h.updateAnnotation('o9QJWDHoEeeVHo_xoqQx0Q', {text: 'yay!'}).then((data)=> {
    console.log(data);
});

// Get profile info
h.getProfile().then((data)=> {
    console.log(data);
});

FAQs

Package last updated on 06 May 2017

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