hypothesis-api-client

0.1.14 • Public • Published

hypothesis-api-client

NPM version build-test dependencies Status Try hypothesis-api-client on RunKit Coverage percentage

A Hypothes.is API client for browser and server-side

Installation

$ npm install --save hypothesis-api-client

Usage

const HypothesisClient = require('hypothesis-api-client');

let hypothesisClient = new HypothesisClient(TOKEN);

hypothesisClient.searchAnnotations({url: 'https://hypothes.is'}, (err, annotations) => {
  console.log(annotations)
})

Methods

The client currently supports the following methods. JSDoc can be found here.

Annotations

  • createNewAnnotation(annotation, callback)
  • createNewAnnotations(annotationsArray, callback)
  • fetchAnnotation(id, callback)
  • updateAnnotation(id, annotation, callback)
  • deleteAnnotation(id, callback)
  • deleteAnnotations(annotationsArray, callback)
  • searchAnnotations(data, callback): Search up to 10K bulk annotations in parallel (faster). Maybe it will be deprecated.
  • searchBunchAnnotations(data, offset, callback): Search a bunch (up to 200) of annotations giving an offset (up to 9.8K)
  • searchAnnotationsSequential: Search over 10K bulk annotations sequentially (slower).

Groups

Users

License

MIT © Haritz Medina

Package Sidebar

Install

npm i hypothesis-api-client

Weekly Downloads

2

Version

0.1.14

License

MIT

Unpacked Size

46.2 kB

Total Files

6

Last publish

Collaborators

  • haritzmedina