Skip to the page
Docs articles

Install the widget

Paste one snippet into your site or app, and the widget shows up on every page within moments.

Last updated

View as Markdown
On this page

The install guide in Notert writes your snippet with your workspace already in it, and tells you once it sees the widget live on your site. Pasting it takes a minute; this page also covers what the snippet does, how to test it, and how to start it only once a visitor agrees to it.

Before you start

  • Conversations is on. It's off for a new workspace, and an owner or admin switches it on. The Widget page appears once it's on.
  • Your workspace has a website. The widget only answers on your own websites, so the guide asks for one before it shows the snippet. Owners and admins set it, and add any other websites the widget works on.
  • Anyone on the team can copy the snippet. Opening the guide and copying from it needs no particular role, so a developer who is a member can do it on their own.

Add it to your site

  1. Open Settings (opens Notert in a new tab), then General (opens Notert in a new tab) under Conversations, and switch Conversations on under Status if it's off.
  2. Open Widget (opens Notert in a new tab) under Conversations, and press Open guide.
  3. Under Where it works, check your website is listed. If it isn't, add it there: the widget only works on your own websites. If your app lives on another domain, add that too. See where the widget works.
  4. Under Where it opens, pick Chat bubble for a round button in the corner of every page, or Your own button to open it from a Help link in your app.
  5. Under Add it to your site, pick a theme, Light, Dark or Match site, and press the copy key on the snippet. See light, dark or match your site.
  6. Paste the snippet just before </body> on every page of your site, or once in the layout every page shares.
  7. With your own button, add data-notert-toggle to the button or link that should open the widget.
  8. Deploy, then open a page of your site. Within moments, Check it's live shows your site's address.

If you belong to other workspaces whose widget works on the same websites, the guide lists them above the snippet with a link to each one's own guide. Each workspace has its own inbox, and a visitor sees no difference between two widgets, so check you copied the snippet from the workspace whose inbox those pages' conversations should reach.

Working with an AI coding agent? Under Add it to your site, press Copy prompt beside AI prompt and paste it into the agent: it carries your snippet and tells the agent where it goes and how to identify signed-in users. It names your identity secret only by its environment variable, NOTERT_IDENTITY_SECRET. The guide's other tabs, Signed-in users and Your button, and Look on the plan that includes widget designs, each have a prompt of their own for adding that part to a site that has the widget already.

What the snippet looks like

Copy yours from the guide rather than from here, since it carries your workspace's id in place of YOUR_WORKSPACE_ID, and names your workspace in a comment beside it so whoever reads your code later knows which inbox it reaches:

<script>
  window.$notert=window.$notert||[];window.notert=window.notert||new Proxy({},{get:(_,p)=>typeof p=="string"&&p!="then"&&/^[a-z]/i.test(p)?(...a)=>window.$notert.push([p,...a]):void 0});
  window.notert.init("YOUR_WORKSPACE_ID",{widget:true,theme:"page"}); /* The Brightline workspace's inbox */
</script>
<script type="module" async src="https://app.notert.io/embed/v1.js"></script>
  • The first script sets up window.notert, which keeps any call you make before the widget has loaded and plays it back once it has. So you can call window.notert.identify(...) straight away, in any order. Its init names your workspace and the options you picked: launcher:false joins them when you pick Your own button.
  • The second loads the widget itself, as a module, without holding up your page.

The two work in either order, so a framework that moves the module into <head>, ahead of the small script, still draws the widget. Only the first init on a page counts, so a layout that renders the snippet again never draws a second widget. Every option init takes is in the JavaScript reference.

On a whole page

Here's the snippet in place on a plain HTML page, with a signed-in user named and a Help link of your own beside the round button:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Brightline</title>
  </head>
  <body>
    <nav>
      <a href="/">Home</a>
      <button type="button" data-notert-toggle="help">Help center</button>
    </nav>

    <main>…</main>

    <script>
      window.$notert=window.$notert||[];window.notert=window.notert||new Proxy({},{get:(_,p)=>typeof p=="string"&&p!="then"&&/^[a-z]/i.test(p)?(...a)=>window.$notert.push([p,...a]):void 0});
      window.notert.init("YOUR_WORKSPACE_ID",{widget:true,theme:"page"});
      // Only on a page your server renders for a signed-in user:
      window.notert.identify("TOKEN_YOUR_SERVER_SIGNED");
    </script>
    <script type="module" async src="https://app.notert.io/embed/v1.js"></script>
  </body>
</html>

The identify line is optional. Leave it out and every visitor writes as a guest; add it and their conversations follow them to every device. See identify your signed-in users.

On a website builder or tag manager

The snippet goes where your platform puts code on every page. Each guide shows where, how to check it, and what trips people up on that platform:

  • WordPress, with a code snippets plugin or a small must-use plugin, and no Notert plugin
  • Shopify, in your theme's theme.liquid
  • Webflow, in your site's custom code
  • Framer, in your project's custom code
  • Google Tag Manager, as a Custom HTML tag

Building with a bundler, in TypeScript or React? Install the npm package instead of pasting the snippet. Add it to your site links to it under the snippet.

Open it from your own button

In your product, people usually look for help in the sidebar, the account menu or the header, not in the corner. Pick Your own button under Where it opens: the snippet then passes launcher: false, which leaves out the round button, and you give the attribute to your own Help item:

<button type="button" data-notert-toggle>Help</button>

A press opens the widget and another closes it. To show how many replies wait unread on that button, as the round button does, listen for changes with window.notert.on("change", ...). See your own button.

Want both? Add the chat bubble's snippet to your website and your own button's to your app.

Check it works

  1. Open a page of your site in a browser, on an address that's under Where it works. The round button appears in the corner once the page has finished loading, or your own button opens the panel.
  2. Open your browser's developer tools and look in the console for a line that starts with Notert:. There's none when all is well. When the widget can't answer the page, the line says why. See troubleshooting.
  3. Send yourself a message from the widget, such as "Testing the widget". It lands in your Inbox (opens Notert in a new tab) at once, and a reply you send from there shows in the widget live.
  4. Look at Check it's live in the install guide. It shows the address it last saw the widget on, and how long ago.

Start it only once a visitor agrees

If your site asks visitors before it runs anything beyond what it needs, keep both scripts on the page and take init out of the first one. Then call init from your consent tool once the visitor agrees:

<script>
  window.$notert=window.$notert||[];window.notert=window.notert||new Proxy({},{get:(_,p)=>typeof p=="string"&&p!="then"&&/^[a-z]/i.test(p)?(...a)=>window.$notert.push([p,...a]):void 0});
  // No init here: startNotert() below starts the widget once the visitor agrees.
  function startNotert() {
    window.notert.init("YOUR_WORKSPACE_ID", { widget: true, theme: "page" });
  }
</script>
<script type="module" async src="https://app.notert.io/embed/v1.js"></script>

Most consent tools run a function or fire an event once a visitor agrees, and again on each later page for a visitor who already did. Call startNotert() from there. If a visitor withdraws, call window.notert.shutdown({ forget: true }), which takes the widget off the page and lets go of what it kept in their browser. See shutdown.

Until init is called, the widget's script loads nothing more, draws nothing and stores nothing. Loading the script itself is still a request to Notert, so if your consent tool must hold back every request to another service, let it add both scripts instead. What the widget keeps, and when, is in what the widget records about visitors.

What it costs your page

  • Nothing before your page is ready. The widget's script waits for your page to finish loading and for a quiet moment, then draws the launcher. The panel loads only as someone points at the launcher or opens it, or when a reply from your team is waiting for them.
  • No clashing styles. The widget draws inside a shadow root, so your CSS never reaches it, and its CSS never reaches your page. Its font goes under a name of its own, so it never replaces yours.
  • Always up to date. The script changes with every Notert release, and your pages pick the new one up on their next load. Load it from Notert as the snippet does, rather than copying it to your own server or pinning it with an integrity hash.

Start here

Up and down arrowsto moveEnterto openEscto close