npm
, pnpm
, or yarn
)Create a new demo app
cdp-app
to create a new Next.js app:Copy your Project ID
useEvmAddress
, useSendEvmTransaction
, etc.) or CDP components (AuthButton
, Button
, etc.) must include the "use client"
directive. Your root layout and any components without CDP functionality can remain server components.Common errors without 'use client'
"use client"
directive in components that use CDP functionality, you’ll see errors like:TypeError: createContext is not a function
Error: useContext must be used within a Provider
window is not defined
or document is not defined
ReferenceError: localStorage is not defined
"use client"
as the first line in any component file that uses CDP hooks or components.useSignInWithEmail
, useEvmAddress
, and useSendEvmTransaction