This reference describes the configuration requirements to setup DevLink in a React project for component imports.
Install the Webflow CLI and the necessary dependencies to import React components into Webflow:
What you get:
@webflow/webflow-cli - CLI used to publish components to Webflow@webflow/data-types - TypeScript definitions for Webflow props@webflow/react - React utilities for code componentsSee the CLI reference for publishing commands.
webflow.jsonThe webflow.json file is used to configure DevLink for component imports. Use this file to define the name of your library and the components that should be included in the library. Additionally, you can specify a custom webpack configuration file to use for bundling your components.
Create or update webflow.json in the root of your project with the following configuration:
When importing your component library to Webflow using the webflow devlink import command, the Webflow CLI prompts you to authenticate with Webflow. Once authenticated, DevLink will save the token to your .env file.
To authenticate manually with Webflow, run the webflow devlink import command with the --api-token option and include a Workspace API token in the command.
Authenticating in this way is useful when sharing your component library to a different workspace.
DevLink publishes your component library to a Webflow workspace. To publish to the correct workspace, you must provide a workspace API token for authentication.
You must be a Workspace Admin to create a Workspace token.
To get your workspace API token:
.env file.Never commit your .env file to version control. Be sure to add .env to your .gitignore file.
After configuration, you can: