Miss any of our Open RFC calls?Watch the recordings here! »

@putdotio/api-client

8.6.1 • Public • Published

@putdotio/api-client

Build Status Coverage Status npm (scoped) npm bundle size (scoped) GitHub

JavaScript library for Put.io API v2.

Installation

npm install @putdotio/api-client

ES Modules / TypeScript

import PutioAPI from '@putdotio/api-client'

CommonJS

const PutioAPI = require('@putdotio/api-client').default

Usage

const API = new PutioAPI({ clientID: 'OAUTH_CLIENT_ID' })
 
API.setToken('XYZ')
 
API.User.Info()
  .then(r => console.log('Fetched user info: ', r))
  .catch(e => console.log('An error occurred while fetching user info: ', e))

API

Options

Prop Type Default Value Description
clientID number 1 OAuth app client ID, defaults to put.io web app
baseURL string api.put.io/v2 Base URL of the API
webAppURL string app.put.io Base URL of the Put.io web app, used in the authentication flow

Methods

Name Parameters Return Value
setToken (token: string) PutioAPIClient Instance

Events

Value Payload Description
ERROR IPutioAPIClientError Fired when an HTTP request fails
CLIENT_IP_CHANGED { IP: string, newIP: string } Fired when the IP of the client changes

Install

npm i @putdotio/api-client

DownloadsWeekly Downloads

77

Version

8.6.1

License

MIT

Unpacked Size

267 kB

Total Files

96

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar