Guides
Frameworks - Tools
NextJS
8min
You can use NextJS API paths to define and expose your mini-app and publish it on Vercel.
This section is being reviewed and expanded.
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/metadata
- One deployed, the metadata endpoint will be accesible at a URL like:
- https://your-domain.vercel.app/api/metadata
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 Nov 2024
Did this page help you?