Journeeze Docs Early access

Install the SDK

Pick one way to install. Both load the same code. You need the site key the Journeeze team sent you.

npm (bundled apps)

npm install @journeeze/sdk@0.1.0-rc.3 --save-exact

Pin an exact version. Release candidates (-rc.N) are on the rc tag. Stable releases are on latest.

React

import { JourneezeProvider, useJourneeze } from "@journeeze/sdk/react";

export function Root() {
  return (
    <JourneezeProvider
      siteKey={config.journeezeSiteKey}      // public, from runtime config
      apiHost={config.journeezeApiHost}      // staging and local only; see "Environments"
      context={{ persona: "owner", journeyId: "billing", journeyStep: "route.billing.pay" }}
      pagePath="none"                        // you pass route ids as journeyStep
    >
      <App />
    </JourneezeProvider>
  );
}

function HelpButton() {
  const jz = useJourneeze();
  return <button onClick={() => jz.enableHelp()}>Help</button>;
}

Without React

import { createJourneeze } from "@journeeze/sdk";

const jz = createJourneeze({ siteKey: "pk_...", apiHost: "https://app.staging.journeeze.dev" });
document.querySelector("#help")?.addEventListener("click", () => jz.enableHelp());

Script tag (no bundler)

<script type="module"
  src="https://app.journeeze.dev/sdk/script.js"
  data-journeeze-site-key="pk_..."
  data-journeeze-help></script>

The tag creates window.Journeeze. It is a module script, so it runs after your inline scripts. Use it from a click, or after DOMContentLoaded. Never use it while the page is still loading:

<button id="suggest">Suggest an improvement</button>
<script>
  document.addEventListener("DOMContentLoaded", () => {
    document.getElementById("suggest").addEventListener("click", () => window.Journeeze?.enable());
  });
</script>
AttributeEffect
data-journeeze-site-keyRequired. Your site key.
data-journeeze-api-hostThe collector origin. Required outside production. See below.
data-journeeze-api-pathPath prefix, only for a same-origin proxy.
data-journeeze-helpShows the help launcher at once.
data-journeeze-chatHelp opens as a conversation instead of the guide panel.

/sdk/script.js is always the SDK version the Journeeze service currently runs. To control the version yourself, install from npm and pin it.

Environments and apiHost

The SDK sends to production (https://app.journeeze.dev) unless you set apiHost. It does not follow where the script was loaded from. A staging or local site key sent to production is refused. Set apiHost next to the site key in each environment’s config:

EnvironmentapiHost / data-journeeze-api-host
Productionleave it out
Staginghttps://app.staging.journeeze.dev
Local Journeeze stackhttp://localhost:8080
Your own same-origin proxyyour origin, for example https://www.example.com

The browser calls the collector directly with CORS, only from the origins you registered. Requests carry no cookies and are not cached.

A proxy is optional. It suits offices or CI where many users share one IP address, or a policy that allows no third-party requests. Ask the Journeeze team for the proxy guide. It covers the gateway key, the paths to forward, and reference Worker and server code.

Content Security Policy

If your site sends a CSP, add these. Use https://app.staging.journeeze.dev on staging.

script-src   'self' https://app.journeeze.dev;
connect-src  'self' https://app.journeeze.dev;
img-src      'self' blob: https://app.journeeze.dev;
media-src    'self' https://app.journeeze.dev;
style-src    'self' 'nonce-<your nonce>';

Turn help and feedback on

In-app help shows a launcher that opens guides built from your published journeys.

await jz.enableHelp();   // loads the help code and shows the launcher
jz.isHelpEnabled();      // true
jz.disableHelp();        // removes it

The feedback mode asks for consent first:

await jz.enable();       // turns the feedback mode on (asks for consent first)
jz.disable();
jz.isEnabled();

Signals (optional)

Aggregate behaviour signals: rage clicks, dead clicks, hesitation, abandoned journey steps and your own registered signals. They are computed in the browser. Only the derived signal is sent, with no URL, text, user id or session id.

createJourneeze({
  siteKey,
  signals: {
    enabled: true,
    tflo: () => import("tflo-browser-events"), // pass your copy if your app already uses it
  },
});

Next: connect GitHub.