-
Bootstrap a Next.js project and add this plugin.
$ pnpm create next-app --yes ✔ What is your project named? … cool-demo # ... $ cd cool-demo $ pnpm add swc-plugin-use-prompt
-
Add the plugin to your
next.config.ts
const nextConfig = { experimental: { swcPlugins: [["swc-plugin-use-prompt", {}]], }, };
-
Add your OpenAI key to the
OPENAI_API_KEY
environment variable (possibly using a.env
file) -
Run
pnpm dev
andpnpm use-client
in parallel.
nextjs-app-router-basic
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||