@nangohq/frontend.
Instantiate the frontend SDK
import Nango from '@nangohq/frontend';
let nango = new Nango({ publicKey: '<PUBLIC-KEY>' });
Show child attributes
Show child attributes
object
required
Hide options
Hide options
string
required
Get your public key in the environment settings of the Nango UI. This is key is not sensitive.
string
Omitting the host points to Nango Cloud. For local development, use
http://localhost:3003. Use your instance URL if self-hosting.string
For self-hosted instances only to specify a customs path for the WebSocket connection.
number
Specify a specific width for the OAuth authorization modal.
number
Specify a specific height for the OAuth authorization modal.
boolean
Print additional console logs to debug authorization issues.
Collect & store end-user credentials
You store end-user credentials with thenango.auth method. It creates a connection in Nango.
- OAuth
- API Key
- Basic Auth
For OAuth, this will open a modal to let the user log in to their external account.
const result = await nango.auth('<INTEGRATION-ID>', '<CONNECTION-ID>').catch((error) => {
...
});
For API key authorization, pass the end-user’s previously-collected API key directly in the parameters.
const result = await nango.auth('<INTEGRATION-ID>', '<CONNECTION-ID>', {
credentials: { apiKey: '<END-USER-API-KEY>' }
}).catch((error) => {
...
});
For Basic Auth, pass the end-user’s previously-collected username & password in the parameters.
const result = nango.auth('<INTEGRATION-ID>', '<CONNECTION-ID>', {
credentials: { username: '<END-USER-API-KEY>', password: '<END-USER-PASSWORD>' }
}).catch((error) => {
...
});
Show child attributes
Show child attributes
string
required
The integration ID that you can find in the integration settings on the Nango UI.
string
required
The connection ID that you can find in the Connections tab on the Nango UI.
object
Hide options
Hide options
object
Specify additional connection configuration necessary to perform the authorization request.
string
HMAC key to secure the authorization flow (cf. (instructions)[TODO]).
boolean
If
true, nango.auth() would fail if the login window is closed before the authorization flow is completed.object
For OAuth, specify the query parameters of the authorization URL.
string[]
For Slack OAuth, specify user-specific scopes.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Questions, problems, feedback? Please reach out in the Slack community.