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:
Name | Type | Description |
---|---|---|
options | object | - |
options.callback | (authUrl : string) => Promise<string> | - |
options.insecure? | boolean | whether to user non-TLS-encrypted connections |
options.redirectUri | string | - |
options.responseType | "fragment" | - |
options.server | string | an 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:
Name | Type | Description |
---|---|---|
options | object | - |
options.callback | (authUrl : string) => Promise<http.IncomingMessage> | - |
options.insecure? | boolean | whether to user non-TLS-encrypted connections |
options.redirectUri | string | - |
options.responseType | "form" | - |
options.server | string | an 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:
Name | Type | Description |
---|---|---|
options | object | - |
options.insecure? | boolean | whether to user non-TLS-encrypted connections |
options.server | string | an endpoint to use for Dasha APIs |
Returns: Promise<Account>