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

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

Returns

Promise<VariableCollection>

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

Example

1// Get Collection
2const defaultVariableCollection = await webflow.getDefaultVariableCollection();
3
4// Fetch all variables within the default collection
5const variables = await defaultVariableCollection?.getAllVariables();

Designer Ability

Checks for Authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canReadVariablesAnyAnyAnyAny