Install / Embed Script

The Cueflow embed script displays messages (banners, modals, checklists, feedback surveys, and changelogs) to your users directly in your application.

Installation

Add the script tag to your HTML, before the closing </body> tag:

<script
  src="https://script.cueflow.so/embed/cueflow.js"
  data-workspace-id="YOUR_WORKSPACE_ID">
</script>

Find your Workspace ID on the Install page in the Cueflow dashboard.

Basic Setup

After loading the script, initialize Cueflow with your user's data:

<script>
  Cueflow.init({
    id: 'user-123',           // Required - unique user identifier
    email: '[email protected]',
    name: 'Jane Smith',
    plan: 'pro'
  });
</script>

Complete Example

How It Works

  1. Script loads - Cueflow script initializes on your page

  2. User identified - You call Cueflow.init() with user data

  3. Messages fetched - Cueflow checks which messages match this user

  4. Messages displayed - Matching banners, modals, etc. are rendered

  5. Navigation tracked - On SPA navigation, messages are re-evaluated

Available Methods

Method
Description

Cueflow.init(user)

Initialize with user data

Cueflow.update(data)

Update user attributes

Cueflow.track(event, props)

Track custom events

Cueflow.check()

Manually check for messages

Cueflow.shutdown()

Remove all messages and cleanup

Framework Integration

React / Next.js

Vue.js

Angular

SPA Support

Cueflow automatically detects navigation in Single Page Applications by listening to:

  • pushState / replaceState calls

  • popstate events

When navigation is detected, Cueflow re-evaluates targeting rules and shows/hides messages accordingly.

If your SPA uses a custom routing mechanism, call Cueflow.check() after navigation to manually trigger message evaluation.

Next Steps

Last updated