auth

Authentication module for the Voxel51 Vision Services API.

Copyright 2017-2018, Voxel51, LLC
voxel51.com

Source:

Classes

Token
TokenLoadError

Methods

activateToken(path)

Activates the given token by copying it to ~/.voxel51/api-token.json. Subsequent API instances will now use this token for authentication.

Parameters:
Name Type Description
path string

path to an API token JSON file

Source:

deactivateToken()

Deactivates (deletes) the currently active token, if any. The active token is the token at ~/.voxel51/api-token.json.

Source:

loadToken(tokenPathopt) → {Token}

Loads the active API token.

Parameters:
Name Type Attributes Default Description
tokenPath string <optional>
null

optional path to a valid Token JSON file. If no path is provided as an argument, the VOXEL51_API_TOKEN environment variable is checked and, if set, the token is loaded from that path. Otherwise, the token is loaded from ~/.voxel51/api-token.json

Source:
Throws:

if no valid token was found

Type
TokenLoadError