This is a Next.js project bootstrapped with create-next-app
, that also has Dynamic integrated out of the box!
- Clone this repository
git clone https://github.com/dynamic-labs/create-next-app-dynamic
- Install dependancies
npm i
# or
yarn
# or
pnpm install
- Add your env variable
Rename .env.example
to .env.local
and add your Dynamic Project ID as the value of the DYNAMIC_PROJECT_ID
variable.
You can find your Dynamic project ID in the developer section of your dashboard.
- Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
-
Server & Client components The Dynamic SDK needs to be used as a client component. You'll see a folder called
lib
where we employuse client
and the export the SDK from there, so that it's compatible for use in the rest of the Next application. -
CSS customisations In globals.css you'll see an example of using custom CSS variables to change the Connect Wallet button from Dynamic.