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.