(sync)
- getRecord - Returns data synced with Nango Sync, allowing for advanced filtering, sorting, and pagination options.
- createTrigger - Triggers an additional, one-off execution of specified sync(s) for a given connection or all applicable connections if no connection is specified.
- start - Starts the continuous execution of specified sync(s) for a given connection or all applicable connections if no connection is specified.
- pause - Pauses the continuous execution of specified sync(s) for a given connection or all applicable connections if no connection is specified.
- getStatus - Get the status of specified sync(s) for a given connection or all applicable connections if no connection is specified.
- updateFrequency - Override a sync's default frequency for a specific connection or revert to the default frequency.
Returns data synced with Nango Sync
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
const result = await nango.sync.getRecord({
model: "Expedition",
connectionId: "<value>",
providerConfigKey: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetSyncRecordRequest | ✔️ | 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<components.GetSyncRecordResponse[]>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.SDKError | 4xx-5xx | / |
Triggers an additional, one-off execution of specified sync(s) (for a given connection or all applicable connections if no connection is specified).
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
await nango.sync.createTrigger({
providerConfigKey: "<value>",
syncs: [
"<value>",
],
});
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.CreateSyncTriggerRequest | ✔️ | 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 | / |
Starts the continuous execution of specified sync(s) (for a given connection or all applicable connections if no connection is specified).
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
await nango.sync.start({
providerConfigKey: "<value>",
syncs: [
"<value>",
],
});
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.CreateSyncStartRequest | ✔️ | 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 | / |
Pauses the continuous execution of specified sync(s) (for a given connection or all applicable connections if no connection is specified).
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
await nango.sync.pause({
providerConfigKey: "<value>",
syncs: [
"<value>",
],
});
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.CreateSyncPauseRequest | ✔️ | 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 | / |
Get the status of specified sync(s) (for a given connection or all applicable connections if no connection is specified)
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
const result = await nango.sync.getStatus("<value>", "<value>", "<value>");
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
providerConfigKey |
string | ✔️ | The ID of the integration you established within Nango |
syncs |
string | ✔️ | The name of the syncs you want to fetch a status for. Pass in "*" to return all syncs per the integration |
connectionId |
string | ➖ | The ID of the connection. If omitted, all connections will be surfaced. |
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.GetSyncStatusResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.SDKError | 4xx-5xx | / |
Override a sync's default frequency for a specific connection, or revert to the default frequency.
import { Nango } from "@speakeasy-sdks/nango";
const nango = new Nango();
async function run() {
const result = await nango.sync.updateFrequency({
providerConfigKey: "<value>",
connectionId: "<value>",
syncName: "<value>",
frequency: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.UpdateConnectionFrequencyRequest | ✔️ | 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<components.UpdateConnectionFrequencyResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.Response400 | 400 | application/json |
errors.SDKError | 4xx-5xx | / |