auth

Functions

authorize

authorize(options: { callback: (authUrl: string) => Promise<string> ; insecure?: boolean ; redirectUri: string ; responseType: "fragment" ; server: string }): Promise<Account>

Authorize the user on the Dasha platform, returning an Account object with their credentials.

When callback is called, it should open the provided authUrl in a browser window. There will be a login form that, when the user logs in, redirects them to redirectUri. It should then return the fragment (hash) part of the URI.

This function is only implemented for Node.js.

Parameters:

NameTypeDescription
optionsobject-
options.callback(authUrl: string) => Promise<string>-
options.insecure?booleanwhether to user non-TLS-encrypted connections
options.redirectUristring-
options.responseType"fragment"-
options.serverstringan endpoint to use for Dasha APIs

Returns: Promise<Account>

authorize(options: { callback: (authUrl: string) => Promise<http.IncomingMessage> ; insecure?: boolean ; redirectUri: string ; responseType: "form" ; server: string }): Promise<Account>

Authorize the user on the Dasha platform, returning an Account object with their credentials.

When callback is called, it should open the provided authUrl in a browser window. There will be a login form that, when the user logs in, redirects them to redirectUri. The caller must listen at the provided URI with an HTTP server and return the first request that comes.

This function is only implemented for Node.js.

Parameters:

NameTypeDescription
optionsobject-
options.callback(authUrl: string) => Promise<http.IncomingMessage>-
options.insecure?booleanwhether to user non-TLS-encrypted connections
options.redirectUristring-
options.responseType"form"-
options.serverstringan endpoint to use for Dasha APIs

Returns: Promise<Account>


startTrial

startTrial(options: { insecure?: boolean ; server: string }): Promise<Account>

Get a new free trial API key.

Parameters:

NameTypeDescription
optionsobject-
options.insecure?booleanwhether to user non-TLS-encrypted connections
options.serverstringan endpoint to use for Dasha APIs

Returns: Promise<Account>

Found a mistake? Email us, and we'll send you a free t-shirt!

Enroll in beta

Request invite to our private Beta program for developers to join the waitlist. No spam, we promise.