Authenticate with Webflow

Learn about authentication options for the Webflow CLI.

To access some Webflow resources via the CLI, you’ll need to authenticate with your Webflow account.

The Webflow CLI supports two types of authentication for different products:

Authentication methodDescriptionSupported products
Site authenticationAuthenticate a single site. This is the default CLI method.DevLink
Webflow Cloud
Workspace authenticationAuthenticate with your Webflow workspace to deploy components to a single workspace.Code Components

Site authentication

Authenticate with your Webflow account to access site-specific resources:

$webflow auth login

This command opens your browser to authenticate with Webflow, where you can grant access to one or more sites.

After you’ve authenticated, the CLI will prompt you in your terminal to select a specific site for your current project. It will then create or update an .env file in your project’s root with the WEBFLOW_SITE_ID and WEBFLOW_API_TOKEN for the site you selected.

.env
$WEBFLOW_SITE_ID=your-site-id
>WEBFLOW_SITE_API_TOKEN=your-api-token

No, you can only use site authentication for a single site. If you need to authenticate with multiple sites, you’ll need to re-authenticate for each site.

Workspace authentication

Workspace authentication is only available for Code Components

On initial deployment of a Code Component library, you’ll be prompted to authenticate with Webflow to deploy components to a single workspace.

$webflow library share

If not already authenticated, this command will open a browser window to authenticate your Webflow workspace. After you grant access, the CLI will create or update a .env file in your project’s root with the WEBFLOW_WORKSPACE_ID and WEBFLOW_WORKSPACE_API_TOKEN.

.env
$WEBFLOW_WORKSPACE_ID=your-workspace-id
>WEBFLOW_WORKSPACE_API_TOKEN=your-api-token
Include .env in your .gitignore file

Never commit your .env file to version control. Be sure to add .env to your .gitignore file.

Non-Interactive authentication (for CI/CD)

For automated environments like CI/CD pipelines, you can authenticate non-interactively by passing a Workspace API token directly with the --api-token flag. This method bypasses the standard webflow auth login flow and is primarily used with the webflow library share command.

To deploy a component library to multiple workspaces, generate a unique Workspace API token for each one from your Workspace settings. Then, run the share command for each workspace, passing the corresponding token.

Examples

$# Deploy to a single workspace using a token
>webflow library share --api-token <WORKSPACE_1_API_TOKEN> --no-input
>
># Deploy the same library to a different workspace
>webflow library share --api-token <WORKSPACE_2_API_TOKEN> --no-input

To authenticate with multiple workspaces, you’ll need to create your own Workspace API token for each workspace. Then you can use the --api-token option to share your library to each workspace.

Any user within the workspace can authenticate via the CLI to deploy components to the workspace. However, only Workspace Admins can create a Workspace API token from the settings page in the Workspace dashboard.

Workspace API tokens provide access to workspace-specific resources via the Webflow Data API. They’re used to authenticate the CLI when running the webflow library share command.