(connections)
- list - Returns a list of connections, optionally filtered by connection ID.
- create - Adds a connection using an existing access token, along with optional OAuth or basic authentication credentials, and additional metadata or configuration.
- get - Returns details of a specific connection identified by its connection ID, associated with the specified integration, with optional parameters for force refresh and returning the refresh token.
- delete - Deletes a specific connection identified by its connection ID, associated with the specified integration.
- createMetadata - Set custom metadata for the specified connection.
- update - Update custom metadata for the specified connection.
Returns a list of connections
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
const result = await nango.connections.list("<value>");
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
connectionId |
string | ➖ | Filter the list of connections based on this connection ID. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<components.GetConnectionResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Adds a connection for which you already have an access token
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
await nango.connections.create({});
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.CreateConnectionRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<void>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.SDKError | 4xx-5xx | / |
Returns a specific connection
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
await nango.connections.get("<value>", "<value>", false, false);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
connectionId |
string | ✔️ | The connection ID used to create the connection. |
providerConfigKey |
string | ✔️ | The integration ID used to create the connection (aka Unique Key). |
forceRefresh |
boolean | ➖ | If true, Nango will attempt to refresh the access access token regardless of its expiration status (false by default). |
refreshToken |
boolean | ➖ | If true, return the refresh token as part of the response (false by default). |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<void>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.Response404 | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Deletes a specific connection
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
await nango.connections.delete("<value>", "<value>");
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
connectionId |
string | ✔️ | The connection ID used to create the connection. |
providerConfigKey |
string | ✔️ | The integration ID used to create the connection (aka Unique Key). |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<void>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.Response404 | 404 | application/json |
errors.SDKError | 4xx-5xx | / |
Set custom metadata for the connection.
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
await nango.connections.createMetadata("<value>", "<value>", {});
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
connectionId |
string | ✔️ | The connection ID used to create the connection. |
providerConfigKey |
string | ✔️ | The integration ID used to create the connection (aka Unique Key). |
requestBody |
operations.CreateMetadataRequestBody | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<void>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.SDKError | 4xx-5xx | / |
Update custom metadata for the connection.
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
const result = await nango.connections.update("<value>", "<value>", {});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
connectionId |
string | ✔️ | The connection ID used to create the connection. |
providerConfigKey |
string | ✔️ | The integration ID used to create the connection (aka Unique Key). |
requestBody |
operations.UpdateMetadataRequestBody | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.UpdateMetadataResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.SDKError | 4xx-5xx | / |