Rawuser / Install

How do I add Rawuser to a v0 or Next.js site?

Short answer

Put the tag as a plain <script> first inside <head> in your root layout, app/layout.tsx, then publish.

Do not use next/script. With afterInteractive or lazyOnload, it loads after the page is on screen. In v0, one message in the chat makes the change.

Last checked 25 October 2026 · Agshin Rajabov, founder of Rawuser

Add Rawuser to v0 or Next.js, step by step

A v0 project with a GitHub repository can take either path. The tag and the place are the same.

  1. Copy your tag

    Sign up for the pilot and open the Connect screen. Your tag carries your own ID where this one says YOUR-ID.

    Your tag
    <script data-cfasync="false" src="https://edge.userawuser.com/s/YOUR-ID.js"></script>
    Your real ID is on the Connect screen.
  2. In v0: send this message

    Paste it into v0's chat with your own tag in it.

    Add this script as the first tag inside <head> in the root layout (app/layout.tsx), exactly as written. Use a plain <script> element, not the Script component from next/script, and no async or defer. If the layout has no <head>, add one inside <html>, above <body>. If a lint rule warns about a synchronous script, turn it off for this line only:

    <script data-cfasync="false" src="https://edge.userawuser.com/s/YOUR-ID.js"></script>
    Replace YOUR-ID first.

    Illustration in the v0 style, not a screenshot.

  3. In v0: check what it wrote

    Open the Code tab and the root layout. The tag should sit first inside <head> as a plain <script>, not <Script>.

    app/layout.tsx
    export default function RootLayout({ children }) {
    return (
    <html lang="en">
    <head>
    <script data-cfasync="false" src="…/s/YOUR-ID.js"></script>
    </head>
    <body>{children}</body>
    </html>
    );
    }
    Your real ID is on the Connect screen.
  4. In your code: paste it into the root layout

    Open app/layout.tsx and put the tag first inside <head>, exactly as written. On the Pages Router, put it first inside <Head> in pages/_document.tsx.

    app/layout.tsx
    export default function RootLayout({ children }) {
    return (
    <html lang="en">
    <head>
    <script data-cfasync="false" src="…/s/YOUR-ID.js"></script>
    </head>
    <body>{children}</body>
    </html>
    );
    }
    Your real ID is on the Connect screen.
  5. In v0: publish

    Select Publish in the chat header, then Publish Changes. The tag reaches visitors only on the published site.

  6. In your code: deploy

    Commit and deploy the way you always do. The tag reaches visitors once the new build is live.

  7. Check it

    Open the published page once. Within ten seconds the Connect screen says Tag found. In the page source, the tag sits inside <head>.

    view-source:your-site
    <head>
    <script data-cfasync="false" src="…/s/YOUR-ID.js"></script>
    <meta charset="UTF-8">
    <title>…</title>

How do I add a script to the head in the Next.js App Router?

Write a plain <script> element inside <head> in the root layout, app/layout.tsx, and React puts it in the HTML the server sends.

The root layout is the file that defines <html> and <body>. Some projects keep it in src/app/layout.tsx. If it has no <head>, add one inside <html>, above <body>.

Next.js's docs ask you not to write <title> or <meta> there by hand. A script is not on that list.

In the HTML Next.js sends, its own stylesheets and async scripts sit above the tag. That is fine. None of them holds the page, and the body comes after the tag.

On the Pages Router, the tag goes first inside <Head> in pages/_document.tsx.

Where is the head in a v0 project?

In the root layout of a Next.js app, because v0 defaults to Next.js.

v0's docs say new chats start with a Next.js app. You can ask v0 to add the tag, or open the Code tab and edit the layout yourself.

v0 can also run Vite projects. There the tag goes first inside <head> in index.html.

If you are not sure, ask v0 in the chat: Is this project Next.js with the App Router?

Why not next/script with afterInteractive or beforeInteractive?

Because none of its three strategies is sure to run the tag before the page is drawn.

Next.js's own guide adds third-party scripts with next/script and names analytics as a good fit for afterInteractive. For analytics that is right. A script that changes words has to run before the page is drawn.

beforeInteractive sounds like the answer, but the server does not send it as a script tag. In the Next.js 16.2.4 source we read, it sends a preload and one line that queues the address. Next.js's own runtime adds the script later, once its own files have loaded, so the page can already be on screen.

A page drawn before the tag runs stays as you built it for that visit.

How you add itWhat Next.js saysFor this tag
Plain <script> first in <head>Rendered into the server HTML as writtenUse this
next/script, afterInteractive (the default)Injected client-side, loads after some or all hydrationToo late
next/script, lazyOnloadLoads during browser idle timeToo late
next/script, beforeInteractiveFetched before Next.js code; does not block hydrationToo late

Does a script tag in the head break hydration?

No. The tag waits until React has taken over each part it rewrites, then writes.

emotix.az runs on Next.js with the tag in its root layout. On 6 October 2026 we made the tag wait for every part it rewrites. In the 180 loads we checked after that, React threw no hydration error (#418).

Next.js's lint rule no-sync-scripts warns about this line, because the script holds the page until it runs. That hold is what keeps the original words off screen, so turn the rule off for this one line.

Does it follow page changes without a reload?

Yes. The tag notices each route change and reads the new page, with no extra code.

Next.js moves between pages without a full reload, and the root layout stays in place. The tag runs once and follows every route change from there.

Does it slow my Next.js page?

Only the lines Rawuser rewrites wait, usually a fraction of a second; if the answer is late, your original stays.

The rest of the page draws as usual. The script stays under 15 KB compressed; our build fails if it grows past that.

Search engines and AI crawlers get the page as you built it.

Does a security policy block the tag on Next.js or Vercel?

Only if your project sets a Content-Security-Policy; Next.js sends none until you add one.

Next.js's guide sets a policy in next.config.js with headers(), or with a nonce in proxy.ts (middleware.ts before Next.js 16). Either way it needs https://edge.userawuser.com in script-src and connect-src.

A policy with 'strict-dynamic' and a nonce ignores those lines. Then the tag needs the page's nonce, read from the x-nonce header in the layout. Next.js's guide says such pages must render on each request.

The Connect screen reads your policy and shows the exact lines.

import { headers } from "next/headers";

export default async function RootLayout({ children }: { children: React.ReactNode }) {
  const nonce = (await headers()).get("x-nonce") ?? undefined;
  return (
    <html lang="en">
      <head>
        <script data-cfasync="false" src="https://edge.userawuser.com/s/YOUR-ID.js" nonce={nonce}></script>
      </head>
      <body>{children}</body>
    </html>
  );
}

How do I check the script tag is in the head?

Open the page source of the published site and look for edge.userawuser.com inside <head>, with no async.

If the address shows up inside self.__next_s instead, it went in through next/script with beforeInteractive. If it shows only in your browser's developer tools and not in the source, it was added after the page loaded. Both need moving to a plain script.

Open the published page once, and within ten seconds the Connect screen says Tag found.

Sources

  1. Next.js docs, Script Component read 25 October 2026
  2. Next.js docs, How to load and optimize scripts read 25 October 2026
  3. Next.js docs, layout.js read 25 October 2026
  4. Next.js docs, How to set a Content Security Policy read 25 October 2026
  5. Next.js, no-sync-scripts lint rule read 25 October 2026
  6. v0 docs, Full-stack apps read 25 October 2026
  7. v0 docs, Code viewer read 25 October 2026
  8. v0 docs, Deployments read 25 October 2026
  9. emotix.az, page source (Next.js, tag in the root layout) read 25 October 2026

Related questions

Start your pilot

See it on your site.

Free for 30 days. Leave your email and your page; we reply within a day with what your own page would say to a visitor from ChatGPT.

We use your email only to reply. Privacy

What happens next

  1. 01

    Within a day, your own page.

    What it would say to a visitor from ChatGPT, written from your page.

  2. 02

    We set it up with you.

    You see your page and its first version before anything goes live.

  3. 03

    Day 31, you decide.

    Keep it from $99 a month, or stop and owe nothing.