Authenticate with Webflow
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:
Site authentication
Authenticate with your Webflow account to access site-specific resources:
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.
Can I use site authentication for multiple sites?
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.
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.
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
Can I authenticate multiple workspaces?
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.
Who can authenticate a 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.
What is a Workspace API token?
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.