1.29.0 • Published 5 years ago

@trd-clarkdwain/trd-box-sdk v1.29.0

Weekly downloads
11
License
Apache-2.0
Repository
github
Last release
5 years ago

TRD BOX Module

Installation

npm install --save @trd-clarkdwain/trd-box-sdk

Getting Started

To get started with the SDK, get a Developer Token from the Configuration page of your app in the Box Developer Console. You can use this token to make test calls for your own Box account.

var TrdBoxSDK = require('trd-box-sdk');

// Initialize the SDK with your app credentials
var sdk = new TrdBoxSDK({
  clientID: 'CLIENT_ID',
  clientSecret: 'CLIENT_SECRET'
});

// Create a basic API client, which does not automatically refresh the access token
var client = sdk.getBasicClient('DEVELOPER_TOKEN');

// Get your own user object from the Box API
// All client methods return a promise that resolves to the results of the API call,
// or rejects when an error occurs
client.users.get(client.CURRENT_USER_ID)
	.then(user => console.log('Hello', user.name, '!'))
	.catch(err => console.log('Got an error!', err));