Skip to content

Add chat to an HTML, React or Next.js site

For hand-built sites: paste one script tag before the closing body tag, or load it with next/script in Next.js. It never blocks your page from rendering.

  • About 5 minutes
  • Comfortable with website settings
  • For: Developers, or owners who edit their own site's code

Before you start, have these ready

  • Access to your site's code and a way to deploy it
  • The website chat add-on, $29 a month on any plan. Email hello@solvetrend.com to add it.
  • Your line switched on: the Receptionist page says "Answering calls." Chat only answers once it is.
  1. Step 1: Copy your chat code

    Sign in, open Settings, and find the Website chat panel. Select the whole line of code in the grey box and copy it. It is one line, and it already contains your account ID.

    It looks like this

    <script src="https://getringhero.com/widget.js" data-org="YOUR_ORG_ID" async></script>
    Code: copy your chat codeCode: copy your chat code

    What you should see

    One line that starts with <script and ends with </script>, with your account ID after data-org=.

  2. Step 2: Plain HTML: paste it before the closing body tag

    In your page template, or in every page if there is no template, paste the line just above </body>. The async attribute means it downloads in parallel and never holds up the page.

  3. Step 3: React with Vite: use index.html

    Paste the same line just above </body> in index.html at the root of the project. There is nothing to import.

  4. Step 4: Next.js: load it with next/script

    In app/layout.tsx, import Script from next/script and add it inside <body>. lazyOnload waits until the page is idle, which suits a chat button. data- attributes are passed through as written.

    app/layout.tsx

    import Script from "next/script";
    
    <Script
      src="https://getringhero.com/widget.js"
      data-org="YOUR_ORG_ID"
      strategy="lazyOnload"
    />
  5. Step 5: Options, if you want them

    data-color="#rrggbb" uses your brand colour. data-theme="light" or "dark" fixes the chat theme. data-mode="inline" puts the chat in the page where the tag is, and adding data-target="#chat" puts it in the element you name instead.

    Any link to #ringhero-chat opens the chat, and window.Ringhero.open() does the same from your own code. Questions: hello@solvetrend.com.

  6. Step 6: Check it on your live site

    Open your website in a new private or incognito window, so you see what a visitor sees. Try it on your phone too.

    No button?

    Make sure the change is published, then refresh the page. If your site has a cookie banner or a cache plugin, clear the cache and look again.

    What you should see

    A green button labelled "Chat" in the bottom right corner of your website. Click it and a chat panel opens above the button, which now says "Close".

  7. Step 7: Ask it a real question

    Ask about your hours and about a price from your price list. Then ask for something you have not told it.

    What you should see

    Answers that match your Receptionist settings. For anything missing, it says the team will confirm and offers to take a name and number.

If a screen is named a little differently from what you see, the steps still apply in the same order. Tell us at hello@solvetrend.com and we will fix the guide.

Hear it answer your business

Upload your price list to the demo and talk to it in under a minute. When you're ready, create your account, set up your receptionist, and we connect your number with you. Every plan starts with a 14-day free trial.