To manipulate the data sources, access the dataSources object on the SDK. Through that, you can invoke all data source methods mentioned, like this:
const oAuthRequestURL = await sdk.integrations.getFigmaOAuthURL()
Read methods
Get data source
Retrieves a single data source by its ID associated with the specified design system version.
async getDataSourceById(
from: RemoteVersionIdentifier,
sourceId: string
): Promise<Source>
Get all data sources
Retrieves all data sources associated with the specified design system version.
async getDataSources(
from: RemoteVersionIdentifier
): Promise<Array<Source>>
Create/update methods
Link Figma source
Links a Figma source to a design system brand.
async linkFigmaSource(
from: RemoteBrandIdentifier,
url: string,
options: {
scopes: {
tokens: boolean
components: boolean
assets: boolean
documentationFrames: boolean
}
autoImport: "Never" | "Hourly"
themeId: string | null
}
): Promise<Source>
Update Figma source
Use this method to update the settings and configuration of an existing Figma source in a specific design system version. You can modify scopes, auto-import mode, and theme ID.
async updateFigmaSource(
from: RemoteVersionIdentifier,
sourceId: string,
options: {
scopes?: {
tokens: boolean
components: boolean
assets: boolean
documentationFrames: boolean
}
autoImport?: "Never" | "Hourly"
themeId?: string | null
}
): Promise<Source>
Claim source ownership
Claims ownership of a Figma source in a design system version.
async updateFigmaSourceClaimOwnership(
from: RemoteVersionIdentifier,
sourceId: string
): Promise<Source>
Delete methods
Delete Figma source
Deletes a Figma source from a design system version.
async deleteFigmaSource(
from: RemoteVersionIdentifier,
sourceId: string
): Promise<void>