Next.js
Learn how to send your first feedback using Next.js and the Remark Node.js SDK.
Prerequisites
To get the most out of this guide, you'll need to:
1. Install
Get the Node.js SDK using your preferred package manager:
Terminal
2. Add environment variable
Add the REMARK_API_KEY
to your .env
file. If you don't have a key yet, sign up and create one from the dashboard.
.env
3. Create a server action
We highly recommend using a server action to send a feedback. Create an action file in app/actions.ts
and add the following code:
app/actions.ts
4. Create a form
The easiest way to send a feedback is through a form. Paste the following code in your app/page.tsx
and paste the following code:
app/page.tsx
5. Try it yourself
Next.js example
See the full source code.
Previous
Node.js