Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,38 @@ Example [Next.js](https://nextjs.org) app for [Webflow Cloud](https://webflow.co
└── wrangler.json
```

## Set up Webflow CLI

Install Webflow CLI (global install is optional; you can also run the CLI without `npx` in the export step below).

```bash
npm install -g @webflow/webflow-cli
```

Log in to Webflow and select your desired workspace from the opened browser window. You can append `--force` to reset any existing authentication.

```bash
npx webflow auth login
```

Then, install the needed dependencies.

```bash
npm install
```

Sync all the Webflow components into your local filesystem. Answer the prompts to generate and configure your `webflow.json`.

```bash
npx webflow devlink export
```

Select your desired Webflow site from the sites listed.

You can also view <a href="https://developers.webflow.com/devlink/reference/overview" target="_blank" rel="noopener noreferrer">our DevLink documentation</a> to learn more about all the options, features, and supported elements.

The `webflow.json` `devlink-export` block tells the Webflow CLI where to write generated React components from your linked Webflow site. After running `webflow cloud init` (or `webflow auth login` + `webflow devlink export`) the CLI populates `./src/webflow/` with components you can import directly into your Vite app.

## Commands

| Command | Action |
Expand Down
4 changes: 4 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import "./globals.css";
import { DevLinkProvider } from "@/webflow/DevLinkProvider";
import { DevLinkFontTags } from "@/webflow/webflow_modules/DevLinkFontTags";
Comment thread
paulvmoreau-webflow marked this conversation as resolved.

export const metadata: Metadata = {
title: "Create Next App",
Expand All @@ -14,6 +15,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<head>
<DevLinkFontTags />
</head>
<body className="antialiased">
<DevLinkProvider>
{/* Add here any Navbar or Header you want to be present on all pages */}
Expand Down
2 changes: 1 addition & 1 deletion webflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"cssScopes": true,
"relativeHrefRoot": "/"
}
}
}