A starter project for creating a Webflow Data Client that demonstrates OAuth authentication and basic API interactions. This project provides a simple example of how to:
- Set up a Webflow Data Client server
- Implement OAuth 2.0 authentication
- Make authenticated API calls
- Display site data in a clean interface
-
Register your app in Webflow's Developer Portal
-
Clone this repository
-
Install dependencies:
npm install # or yarn install
-
Copy
.env.example
to.env
and add your credentials:WEBFLOW_CLIENT_ID=your_client_id WEBFLOW_SECRET=your_client_secret PORT=3000
-
Start the development server:
npm run dev # or yarn dev
-
Create a tunnel to your local server: Webflow requires a public URL to redirect to after authentication. If you're running the server locally, you'll need to create a tunnel to your local server.
ngrok http 3000
-
Copy the HTTPS URL from ngrok (e.g.,
https://your-tunnel.ngrok.io
) -
In the Workspace Settings -> Apps & Integrations -> Your App:
- Set your OAuth Redirect URI to:
https://your-tunnel.ngrok.io/auth
- Add required scopes (this example uses
sites:read
)
- Set your OAuth Redirect URI to:
- Webflow SDK - Official Webflow API client
- Fastify - Fast and low overhead web framework
- Level - Lightweight key-value storage
- Nodemon - Development auto-reload
- This is a development-only example and should not be used in production
- The database is cleared when the server stops (see
cleanup
function) - 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
.
├── app/
│ ├── server.js # Main server file with OAuth and API endpoints
│ └── static/ # Frontend assets
│ ├── index.html # Main UI
│ └── main.js # Frontend JavaScript
├── .env.example # Environment variables template
└── package.json
Feel free to submit issues and enhancement requests!
This project is MIT licensed.