Skip to content

npm package ​

Use the package when your project has a bundler and you want typed imports.

sh
npm install @justonecx/sdk
ts
import { init } from "@justonecx/sdk";

void init({
  publicKey: "pk_your_workspace_key",
  apiUrl: "https://api.justonecx.com",
});

Rules ​

  • Call init() once, in the browser only, after your app mounts.
  • Importing the package on the server is safe. Calling init() on the server is not, because it uses window and document.
  • Always pass apiUrl. The default only works on localhost.
  • If your site sends a Content-Security-Policy header, allow our API in connect-src. Otherwise chat shows "Chat is unavailable right now". See Content Security Policy.
  • With Next.js or Vite, the public key is read at build time. Set NEXT_PUBLIC_* or VITE_* in your CI build as well as locally.

Options ​

See init and options.

Boards ​

The roadmap, ideas and changelog code is not in your main bundle. Your bundler splits it into a chunk that loads the first time you use mountRoadmap and the other board functions. See Embed.

Types ​

The package ships TypeScript types for ESM and CommonJS. No @types package is needed.

Next ​

Frameworks shows where to put init() in each framework.

JustOneCX