Next.js version 13+ (Using App Router)

Follow the below steps to integrate the Atatus RUM agent into your Next.js 13+ application.
  1. Paste the snippet into the root layout.tsx file.
    Here replace YOUR_API_KEY with your API Key. You will find this key in your browser project settings.
  2. Restart your Next.js server.

Next.js version <13 (Using Page Router)

  1. Create an atatus.js file inside the public/js folder and paste our Atatus (async CDN) script. Make sure to remove the opening and closing <script> tags.
    Here replace YOUR_API_KEY with your API Key. You will find this key in your browser project settings.
  2. Next, you need to create a file called _document.js inside the pages folder. Add a <script> tag inside the <Head> tag as follows:
  3. Restart your Next.js server.