How to detect, test and monitor your Next.js API endpoints with the Checkly CLI

How to detect, test and monitor your Next.js API endpoints with the Checkly CLI

Mar 3, 2024

In this video, we explore how to use the Checkly CLI to programmatically test and monitor Next.js API endpoints. We'll create a dynamic setup that detects new API GET URLs and use GitHub actions to test preview API deployments and deploy API monitoring after production deploys.

Next.js example project: https://github.com/stefanjudis/checkly-next-api-monitoring/
Checkly Community: https://www.checklyhq.com/slack/
Dynamic check docs: https://www.checklyhq.com/docs/cli/dynamic-check-creation/

0:00 Intro

0:41 Next.js setup

2:25 Checkly API Monitoring explained

3:14 How to use the Checkly CLI

4:30 Monitoring as Code with Checkly constructs

6:03 Test and deploy API monitoring

7:30 Dynamic check creation

10:15 Add and detect a new GET endpoint

11:41 Monitoring as Code in CI/CD

12:11 Open a new pull request

13:30 Deploy a Vercel preview environment with GitHub actions

14:41 Checkly test sessions

15:30 Deploy to production with GitHub actions

17:08 Dynamic check creation examples

17:53 Outro

#nextjs #checkly #monitoring