Skip to content

Script tag ​

Use this when you have no build step. It works on any site that lets you add a script.

html
<script
  src="https://app.justonecx.com/sdk/justonecx-sdk.global.js"
  data-public-key="pk_your_workspace_key"
  data-api-url="https://api.justonecx.com"
></script>

Place it before </body>. The script reads its own data-* attributes and starts by itself.

Attributes ​

AttributeRequiredDescription
data-public-keyYesYour workspace public key.
data-api-urlYes on real sitesBackend origin. Without it the SDK uses http://localhost:8000, which only works for local development.
data-track-route-changesNoSet to "true" on sites that change pages without a full reload.

Pin a version (optional) ​

The URL above always serves the latest SDK and is cached for five minutes. We recommend it for almost every site. Pin a version only if you need to lock to one release. A pinned file never changes. Replace <version> with the version you want:

html
<script
  src="https://app.justonecx.com/sdk/justonecx-sdk.v<version>.global.js"
  data-public-key="pk_your_workspace_key"
  data-api-url="https://api.justonecx.com"
></script>

See SDK versions.

Calling the API ​

The script adds window.JustOneCX:

js
window.JustOneCX.identify("user-42", { plan: "growth" });
window.JustOneCX.track("clicked_upgrade");
window.JustOneCX.reset();

Board functions are there too: mountRoadmap, mountIdeas, mountChangelog, openChangelog, openRoadmap. The script also registers <justonecx-roadmap>, <justonecx-ideas> and <justonecx-changelog>. When a board first appears the script loads justonecx-boards.global.js from the same place. See Embed.

Calls made before the script has loaded fail. Place your own code after the script tag, or run it after the load event.

Content Security Policy ​

If your site sends a CSP header, allow our script and API origins. See Content Security Policy.

Platform notes ​

Step-by-step paths for each builder are on Website builders. In short:

  • WordPress: add the snippet with a header/footer plugin, or in your theme's footer.php before wp_footer().
  • Webflow: Project settings → Custom code → Footer code.
  • Shopify: edit theme.liquid and paste the snippet before </body>.
  • Google Tag Manager: use a Custom HTML tag that fires on all pages. Add data-track-route-changes="true" if the site is a single-page app.

JustOneCX