Skip to main content
The woku web widget is a micro-app hosted on the woku CDN (cdn.woku.app) that captures woku ratings (1 to 5) or NPS scores (0 to 10) directly from your website. You embed it with a lightweight <script> loader (~2.5 KB gzip) that injects an <iframe> when a trigger fires; you do not need to load any CSS or frameworks on your page.
All of the widget’s styles live inside the <iframe>, in an isolated document. There is no risk of them clashing with your site’s styles, nor of your JavaScript interfering with the widget’s.

How it works

  1. Your page loads the loader from cdn.woku.app.
  2. You call WokuWidget.init(config) with your configuration.
  3. The loader evaluates the triggers (time, scroll, exit, event, click) and, when the first one fires, injects an <iframe> that points to the hosted micro-app.
  4. The micro-app renders the mode based on captureType (woku shows 1-5 stars; nps shows a 0-10 scale), captures the feedback, and sends it to the woku API.
  5. The loader emits events (open, submit, close, skip) that you can listen to with WokuWidget.on(...).

Installation

1

Get your publishable key

In the admin application, go to Company → Integrations and copy the publishable key (pk_...). It is safe to embed in your site’s public HTML.
2

Paste the loader into your site

Place this snippet before </body> on the pages where you want to show the widget.
3

Verify

Open your site and wait for the trigger to fire (in the example, 5 seconds). The widget will appear as a modal.
Always use the publishable key (pk_...) in the widget, never the secret API key. The widget is public code: anyone can inspect its configuration. The publishable key only allows capturing feedback; it does not expose any data from your account.

Authentication: publishable key

The widget authenticates with your company’s publishable key, sending it in the x-woku-key header of every capture. Unlike the secret key (used by server-side integrations), the publishable key:
  • Starts with the pk_ prefix (e.g. pk_live_...).
  • Is safe to embed in public HTML.
  • Only has capture permission (it does not read or manage resources).
You can find it in Company → Integrations of the admin panel (https://admin.woku.app).

Configuration

The object you pass to WokuWidget.init(...) accepts these fields:

Capture type: woku vs NPS

Captures a rating of 1 to 5 stars associated with a wokuId.
In woku mode the user sees 1-5 stars and, optionally, leaves a comment as text or audio.

Language (i18n)

The widget includes two languages: Spanish (es, default) and English (en). The language is resolved in this order:
  1. The lang field of the configuration.
  2. The browser language (navigator.language).
  3. Fallback to es.

Triggers

Each trigger defines when the widget appears and how it is presented (behavior). You can combine several; the first one that is met fires.
Presentation modes (behavior): modal (centered window with overlay), banner (fixed bar), side-tab (side tab), and fullscreen (full screen).

Theme

Customize the widget’s appearance. The values are applied as CSS custom properties inside the iframe (except zIndex, which controls the overlay on your page):

Programmatic API

The loader exposes window.WokuWidget:

CSP requirements

If your site uses Content-Security-Policy, you must allow the CDN origin both for the loader script and for the micro-app iframe:
The loader is loaded as an external <script src="..."> and does not use eval or inline scripts, so you do not need to configure a nonce or unsafe-inline.

Troubleshooting

  • Confirm that some trigger is met (for example, wait out the seconds of a time trigger).
  • Check the browser console: CSP errors indicate that you are missing permission to allow cdn.woku.app in script-src or frame-src.
  • Verify that companyId and publishableKey are correct.
The publishableKey is invalid or does not correspond to the companyId. Copy it again from Company → Integrations.
wokuId is missing, which is required when captureType === 'woku'.
The widget adjusts its height automatically via postMessage. If your site applies overflow: hidden or a transform to the <body>, it may interfere with the overlay. Use behavior: 'fullscreen' as an alternative.