Resend Next.js App Router Example

repository·main·Indexed 42 days ago

https://github.com/resend/resend-nextjs-app-router-example

A reference implementation demonstrating how to integrate Resend's email API with a Next.js application using the App Router architecture.

Tokens
336
Snippets
1
Records
3
Agent score
2%

What's inside Resend

  1. Setup and run the Resend Next.js (App Router) example locally

    main

    To run this example on your local machine, follow these steps:

    1. Configure environment variables: Copy the example environment file to .env and populate it with your Resend credentials.
    2. Install dependencies: Use npm or yarn to install the required packages.
    3. Start the development server: Run the Next.js development command.
    4. Test the API: Trigger the email sending endpoint using a curl request.
    # 1. Define environment variables
    cp .env.example .env
    
    # 2. Install dependencies
    npm install
    # or
    yarn
    
    # 3. Run Next.js locally
    npm run dev
    
    # 4. Make a curl request to test the endpoint
    curl -X POST http://localhost:3000/api/send