Class: Box

Box

The Box object: One instance for each client. This is used to get connections.

new Box(opts, logLevel, logStream)

Parameters:
Name Type Argument Description
opts BoxInit <optional>
<nullable>
Client parameters required for standalone operation. Should be omitted when running with passport authentication middleware.
logLevel string <optional>
<nullable>
Optional log level. Defaults to info.
logStream external:Writable <optional>
<nullable>
Optional writable stream for log output. Defaults to console.
Source:
See:

Methods

authenticate() → {function}

Used with Passport BoxStrategy.
Source:
Returns:
A callback for use in the BoxStrategy.
Type
function
Example
passport.use(new BoxStrategy({
  clientID: BOX_CLIENT_ID,
  clientSecret: BOX_CLIENT_SECRET,
  callbackURL: "http://127.0.0.1:3000/auth/box/callback"
}, box.authenticate()));

getConnection(email) → {Connection}

Get a connection for the provided email id.
Parameters:
Name Type Description
email string The email account identifier to connect to.
Source:
Fires:
Returns:
A connection on which API calls can be made.
Type
Connection

stopServer(callback)

Stop the authorization callback listener when running in standalone mode.
Parameters:
Name Type Description
callback optionalErrorCallback Called after asynchronously stopping the server.
Source:
Copyright © 2014-2015 Aditya Mukhopadhyay
Documentation generated by JSDoc 3.2.2 on Sun Jul 27 2014 08:27:52 GMT+0530 (IST) using the DocStrap template.