A starter project for creating a Webflow Hybrid App that demonstrates OAuth authentication from the Webflow UI and basic Data and Designer API interactions. This project provides a simple example of how to:
- Set up a Webflow Data Client server
- Set up a Webflow Designer Extension frontend
- Authenticate from the Designer Extension
- Make Data API calls
- Make Designer API calls
-
Create a Webflow site if you haven't already at webflow.com
-
Register your app in your Workspace Be sure to add a redirect URI to
localhost:3000/api/auth/callbackand the required scopes:authorized_user: readsites:readsites:writecustom_code:readcustom_code:write
-
Clone this repository and install the dependencies:
npm install # or yarn install -
Install the Webflow CLI:
npm install -g @webflow/cli # or yarn global add @webflow/cli -
Navigate to the
/data-clientfolder and create a.envfile by copying.env.example. Fill in your app credentials, which can be found in your Webflow Dashboard under Integrations > App Development > Your App Details:WEBFLOW_CLIENT_ID=xxx WEBFLOW_CLIENT_SECRET=xxx DESIGNER_EXTENSION_URI=xxx PORT=3000
-
Run the Data Client and Designer Extension together as a Hybrid App. The run command will install the dependencies and start the server and the designer extension:
npm run dev # or yarn dev -
Install your app by navigating to
http://localhost:3000in your web browser. This will redirect you to the Webflow Authorization page where you can authorize the app for your workspace. -
Open your Webflow Site. Open the Apps panel and click on your App. When the panel opens click the "Launch Development App" button
-
Click the Authorize button to authenticate your App and start using the Data and Designer APIs
- Data Client:
- Webflow SDK - Official Webflow API client
- Designer Extension:
- Webflow Designer API - Official Webflow Designer API client
- Vite - Build tool for modern web development
- JWT-Decode - Decode JWT tokens
- React - JavaScript library for building user interfaces
- This is a development-only example and should not be used in production
- The database is cleared when the server stops (see
cleanupfunction) - Access tokens are stored unencrypted - in production, you should:
- Encrypt sensitive data
- Use a proper database
- Implement token refresh
- Add error handling
- Add user sessions
. ├── data-client/ # Backend server │ ├── app/ │ │ ├── api/ # API Routes │ │ │ ├── auth/ # Auth endpoints │ │ │ └── custom-code/ # Custom code endpoints │ │ ├── lib/ # Server utilities │ │ │ ├── controllers/ # Logic for handling requests and responses using the Webflow SDK │ │ └── db/ # Database │ ├── .env.example # Environment template │ └── package.json │ ├── designer-extension/ # Frontend app │ ├── src/ │ │ ├── components/ # React components │ │ ├── hooks/ # Custom hooks │ │ ├── services/ # API services/logic │ │ ├── types/ # TypeScript types │ │ └── App.tsx # Main app component │ ├── .env.development # Dev environment variables │ └── package.json │└── package.json # Root package.json Feel free to submit issues and enhancement requests!
This project is MIT licensed.