APIsChangelog
Log In

Get default variable collection

webflow.getDefaultVariableCollection()

Retrieves the default variable collection. The default collection is the first variable collection created with your site.

📘

Currently, we only support managing variables within the default variable collection

Syntax

webflow.getDefaultVariableCollection(): Promise<null | VariableCollection>;

Returns

Promise<VariableCollection>

A Promise that resolves to the default Variable Collection or null if not found.

Example

// Get Collection
const defaultVariableCollection = await webflow.getDefaultVariableCollection();

// Fetch all variables within the default collection
const variables = await defaultVariableCollection?.getAllVariables();