Guides
Frameworks - Tools
NextJS
6min
You can use NextJS API paths to define and expose your mini-app and publish it on Vercel.
Next.js provides built-in API routes, making it an excellent choice for projects that combine frontend and backend functionality.
Create a new Next.js project:
Install the SDK
Open the project in your preferred editor. For example VSCode
Navigate to the pages/api/example folder and create a file named route.ts:
Save the file and start the development server:
- http://localhost:3000/api/example
- One deployed, the metadata endpoint will be accesible at a URL like:
- https://your-domain.vercel.app/api/example
In the example we have implemented a try-catch to catch any run-time errors. You can create an instance of all the errors that could occur during the execution of createMetadata.
Updated 30 Jan 2025
Did this page help you?