🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

droplr-api

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

droplr-api

Official Droplr API Client for Javascript

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Droplr API Client for Javascript

Official Droplr API client for Javascript. It works both on frontend & backend using Axios library.

npm version MIT licensed npm downloads

Installation

yarn add droplr-api

Testing

yarn install
yarn test

You can also run functional tests (invoking real API) using your Droplr credentials:

USERNAME=my@email.com PASSWORD=MyPassword yarn test:functional

Usage

const Droplr = require('droplr-api');

const client = new Droplr.Client({
  auth: new Droplr.BasicAuth('username', 'password'),
});

const drops = await client.drops.list();
const fileDrop = await client.drops.create({
  type: 'FILE',
  variant: 'image/png',
  title: 'file.png',
  content: fs.createReadStream('some/path/file.png'),
});

const linkDrop = await client.drops.create({
  type: 'LINK',
  content: 'http://some-long-url.com/',
});

const noteDrop = await client.drops.create({
  type: 'NOTE',
  variant: 'text/plain',
  content: 'My note',
});

Authorization Methods

When creating Droplr.Client, you can optionally specify auth class:

  • new Droplr.AnonymousAuth(); (default)
  • new Droplr.BasicAuth('username', 'password');
  • new Droplr.JwtAuth('jwttoken');

Actions

  • client.drops

    • client.drops.get(id, params = {}, options = {})
    • client.drops.list(params = {}, options = {})
    • client.drops.create(data, options = {})
    • client.drops.update(id, data, options = {})
    • client.drops.delete(id, options = {})
    • client.drops.getStats(id, options = {})
    • client.drops.getReferrers(id, options = {})
    • client.drops.view(id, options = {})
    • client.drops.listHits(id, params = {}, options = {})
  • client.users

    • client.users.current(params = {}, options = {})
    • client.users.get(id, options = {})
    • client.users.list(params = {}, options = {})
    • client.users.create(data, options = {})
    • client.users.update(id, data, options = {})
    • client.users.delete(id, options = {})
    • client.users.getTags(id, options = {})
  • client.boards

    • client.boards.get(id, options = {})
    • client.boards.list(params = {}, options = {})
    • client.boards.create(data, options = {})
    • client.boards.update(id, data, options = {})
    • client.boards.delete(id, options = {})
    • client.boards.watch(id, options = {})
  • client.teams

    • client.teams.get(id, options = {})
    • client.teams.list(params = {}, options = {})
    • client.teams.create(data, options = {})
    • client.teams.update(id, data, options = {})
    • client.teams.delete(id, options = {})
  • client.rootRedirect

    • client.rootRedirect.get(params, options = {})

Keywords

droplr

FAQs

Package last updated on 10 Sep 2018

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