AbstractStaticMergeMerge scopes from multiple tools, deduplicating.
Arrays of scopes to merge
Deduplicated array of scopes
AbstractgetRetrieves an access token for a channel resource.
Returns the token of the user who enabled sync on the given channel. If the channel is not enabled or the token is expired/invalid, returns null.
The channel resource ID (e.g., calendar ID)
Promise resolving to the access token or null
Retrieves an access token for a channel resource.
The OAuth provider (deprecated, ignored for single-provider connectors)
The channel resource ID (e.g., calendar ID)
Promise resolving to the access token or null
AbstractactExecute a callback as a specific actor, requesting auth if needed.
If the actor has a valid token, calls the callback immediately with it. If the actor has no token, creates a private auth note in the specified activity prompting them to connect. Once they authorize, this callback fires.
The OAuth provider
The actor to act as
The activity to create an auth note in (if needed)
Function to call with the token
Additional arguments to pass to the callback
AbstractsaveSaves a link with notes to the connector's priority.
Creates a thread+link pair. The thread is a lightweight container; the link holds the external entity data (source, meta, type, status, etc.).
This method is available only to Connectors (not regular Twists).
The link with notes to save
Promise resolving to the saved thread's UUID, or null if the link was filtered out (e.g. older than the plan's sync history limit)
AbstractsaveSaves contacts to the connector's priority.
Array of contacts to save
Promise resolving to the saved actors
AbstractarchiveArchives links matching the given filter that were created by this connector.
For each archived link's thread, if no other non-archived links remain, the thread is also archived.
Filter criteria for which links to archive
Promise that resolves when archiving is complete
AbstractsetSets or clears todo status on a thread owned by this connector.
The link source URL identifying the thread
The user to set the todo for
true to mark as todo, false to clear/complete
Optionaloptions: { date?: string | Date }Additional options
Optionaldate?: string | DateThe todo date (when todo=true). Defaults to today.
Built-in tool for managing OAuth authentication and channel resources.
The Integrations tool:
Connectors declare their provider, scopes, and channel lifecycle methods as class properties and methods. The Integrations tool reads these automatically. Auth and channel management is handled in the twist edit modal in Flutter.
Example