- Source:
Methods
(static) user(params, cb)
- Source:
** NOTE: The login method is currently disabled. Instead, you must use --apiKey "API key"
with every command.
While the login method will not throw an error, it will not create a persistent session with your credentials. **
Logs in the user and acquires an api key. If run from the command line and no email or password option is specified the user is prompted to enter them. Note: the api key is cached in the user's home directory in ~/.paperspace/config.json. You can execute paperspace logout to clear the cached api key. An optional apiToken parameter may also be specified; if specified, an API token with that name must already exist in the user's account.
Examples
** NOTE: The login method is currently disabled. Instead, you must use `--apiKey "API key"` with every command. **
** While the login method will not throw an error, it will not create a persistent session with your credentials. **
paperspace.login.user({
email: 'user@domain.com',
password: 'secretpw',
apiToken: 'API token', // optional; if specified, an API token with that name must already exist in the user's account
}, function(err, res) {
// handle error or result
});
** NOTE: The login method is currently disabled. Instead, you must use `--apiKey "API key"` with every command. **
** While the login method will not throw an error, it will not create a persistent session with your credentials. **
$ paperspace login --email user@mail.com --password "secretpw" --apiKey "API key"
# HTTP request:
https://api.paperspace.io
POST /apiToken/createPublic
# Returns 200 on success
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | Login user parameters Properties
|
||||||||||||||||
cb |
function | Node-style error-first callback function |