No additional configuration is required if you are using the pages router
App Router
If you are using the new app router, and If you import a component such as ThirdwebProvider in a server component, Next.js will throw an error saying that the component is not marked with "use client" directive.
You will need to create an alias for that component in a separate file with "use client" directive on top (before all the imports) and import that instead of using the component directly from @thirdweb-dev/react in server components.
Add below packages as dependencies in your package.json
{
...
"dependencies": {
...
"url": "latest",
"http": "npm:http-browserify",
"https": "npm:https-browserify",
"zlib": "npm:browserify-zlib",
"http-browserify": "latest",
"https-browserify": "latest",
"browserify-zlib": "latest",
"assert": "^2.0.0",
"stream": "^0.0.2"
}
}
Install them from NPM using the following command
npminstall
To ignore the sourcemap warnings, create a .env file with the following in your root directory:
GENERATE_SOURCEMAP=false
New Projects
Create a new project using the thirdweb CLI
npxthirdwebcreateapp
API Key
You will require an API key to use thirdweb's infrastructure services with the SDK. If you haven't created a key yet you can do so for free from the thirdweb dashboard.
Wrap your application in ThirdwebProvider
Wrap your application in the ThirdwebProvider component to start using the SDK.