Next Applications
Key Do’s and Don’ts
✅ Install the JavaScript code below in the Documentation.
✅ Insert the JavaScript in the root index.html page of your documentation webpages.
❌ Do Not install the Reo.Dev tracking code more than once on a single page.
Javascript Code Snippet for Next Applications
You may leverage dangerouslySetInnerHTML to set the snippet inline.
import Script from 'next/script';
<Script
id="reo-script"
strategy="afterInteractive"
defer
dangerouslySetInnerHTML={{
__html: '!function(){var e,t,n;e="XXXXXX",t=function(){Reo.init({clientID:"XXXXXX"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.defer=!0,n.onload=t,document.head.appendChild(n)}()'
}}
/>If you want to avoid inline, you can create a custom file and reference it in src
import Script from 'next/script';
<Script src="/path/to/reo-script.js" strategy="afterInteractive" />And, put the snippet directly in the custom js file.
Verify successful installation of Javascript on documentation webpages
Open a page on your documenation and right-click anywhere on the page.
In the dropdown menu, select Inspect.

In the elements tab, Use the Ctrl + F or Cmd + F and search for “reo.dev”

If the tracking code appears, verify that the code matches.
FAQs
Error Scenarios
Script initiation
Script initiation has been modified to rely on code initiation only on successful callback post download from CDN. So it will only initiate if successfully downloaded. In case the download fails, the docJS won’t get enabled but this eliminates the likelihood of an error scenario of page breaking.
API failure on token delete
On deletion of all Reo tokens, the most recent event tracking data will likely fail, but subsequent API calls will work fine.
Any inadvertent code failure on JavaScript
This should not be an issue since the code is wrapped in a try-catch block, the console may throw errors, which won’t be visible even on the console since logger would be disabled on the script.
If you need assistance with the implementation, contact your Customer Success Manager via the Slack channel or email us at support@reo.dev
Last updated
Was this helpful?

