Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
39
decreased by-64.22%
Maintainers
1
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc