OpenRoadmap Docs

JavaScript API

window.Feedback is the only public client surface. Keep it vanilla — no React runtime ships in the loader.

Feedback.init

init · ts
Feedback.init({
  project: "pk_demo_acme_website",
  apiBase: "https://api.openroadmap.app", // optional
  uiUrl: "https://cdn.openroadmap.app/widget-ui.js", // optional
  theme: {
    primaryColor: "#1F4B99",
    borderRadius: 12,
    mode: "light",
    mascot: { character: "spark", theme: "riso", effect: "float" },
  },
});

Feedback.open / close

Opens the lazy UI panel (downloads widget-ui.js once). close() tears down the panel DOM.

programmatic · js
Feedback.open();
Feedback.close();

Feedback.identify

Attach authenticated visitor traits. See Identify users.

identify · js
Feedback.identify({
  id: "usr_9381",
  email: "john@example.com",
  name: "John",
  plan: "enterprise",
  account: "acme-inc",
});

Feedback.setMascot

mascot · js
Feedback.setMascot({
  character: "bot",
  theme: "midnight",
  effect: "glow",
  mood: "curious",
  accessory: "glasses",
  size: 64,
});

Feedback.submit

Headless submit without opening the UI (support forms, in-app buttons).

submit · js
await Feedback.submit({
  type: "feature", // feature | bug | general | question
  message: "Add CSV export to reports",
  email: "optional@example.com",
});
Note

TypeScript shapes live in @openroadmap/types (IdentifyTraits, WidgetConfigPublic, SubmitFeedbackRequest).