Skip to content

Latest commit

 

History

History

nextjs-app-router-basic

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Example with Next.js

Edit swc-plugin-use-prompt

Setup

  1. 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
  2. Add the plugin to your next.config.ts

    const nextConfig = {
      experimental: {
        swcPlugins: [["swc-plugin-use-prompt", {}]],
      },
    };
  3. Add your OpenAI key to the OPENAI_API_KEY environment variable (possibly using a .env file)

  4. Run pnpm dev and pnpm use-client in parallel.