> ## Documentation Index
> Fetch the complete documentation index at: https://sleekplan.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Show CSAT, feedback, and changelog popups

> Trigger satisfaction surveys, feedback prompts, and changelog announcement popups programmatically with $sleek.showPopup()

Popups let you ask for feedback at the right moment without forcing users to open the widget themselves. Call `$sleek.showPopup()` to display a satisfaction survey (CSAT), a general feedback prompt, or a changelog announcement anywhere in your user's journey.

## Show a popup

```javascript theme={"system"}
$sleek.showPopup(type, message, data, settings);
```

### Parameters

<ParamField path="body.type" type="string" required>
  The type of popup to display. Must be one of:

  * `satisfaction` — A CSAT (Customer Satisfaction) rating prompt
  * `feedback` — A general feedback submission prompt
  * `changelog` — A changelog announcement popup
</ParamField>

<ParamField path="body.message" type="string">
  A custom message to display inside the popup. If omitted, Sleekplan uses the default message configured in your workspace settings.
</ParamField>

<ParamField path="body.data" type="object">
  Additional data for the popup. For `satisfaction` popups, pass a `group` key to tag the CSAT response with a specific group name:

  ```json theme={"system"}
  { "group": "onboarding" }
  ```
</ParamField>

<ParamField path="body.settings" type="object">
  Custom settings to override the popup's default behavior for this specific call.
</ParamField>

## Popup types

### Satisfaction (CSAT)

Use the `satisfaction` type to ask users to rate their experience. Responses are recorded as CSAT scores in your Sleekplan dashboard.

```javascript theme={"system"}
// Basic CSAT prompt with default message
$sleek.showPopup('satisfaction');

// With a custom message
$sleek.showPopup(
  'satisfaction',
  'How satisfied are you with your experience today?'
);

// Tagged CSAT — group responses under "checkout"
$sleek.showPopup(
  'satisfaction',
  'How was your checkout experience?',
  { group: 'checkout' }
);
```

### Feedback

Use the `feedback` type to invite users to submit a new feedback item directly from the popup.

```javascript theme={"system"}
// Basic feedback prompt with default message
$sleek.showPopup('feedback');

// With a custom message encouraging specific input
$sleek.showPopup(
  'feedback',
  'Do you have ideas for improving this feature?'
);
```

### Changelog

Use the `changelog` type to surface a recent update announcement as a popup. This is useful for drawing attention to new features without requiring users to open the full changelog view.

```javascript theme={"system"}
// Show a changelog announcement popup
$sleek.showPopup('changelog');

// With a custom intro message
$sleek.showPopup(
  'changelog',
  'Here is what we shipped this week:'
);
```

<Note>
  Each changelog announcement is shown to a given user only once. After the first display, a one-hour cool-down period applies before another announcement can appear. This prevents consecutive announcements from feeling intrusive.
</Note>

## Trigger popups at the right moment

The most effective popups appear at natural moments in the user's session rather than immediately on page load. Here are common patterns:

<AccordionGroup>
  <Accordion title="After a key action is completed">
    ```javascript theme={"system"}
    function onExportComplete() {
      // Trigger a CSAT prompt after the user exports a report
      $sleek.showPopup(
        'satisfaction',
        'How was your export experience?',
        { group: 'export' }
      );
    }
    ```
  </Accordion>

  <Accordion title="After a time-based delay">
    ```javascript theme={"system"}
    // Ask for feedback after the user has been on the page for 60 seconds
    setTimeout(function () {
      $sleek.showPopup(
        'feedback',
        'Any thoughts on what you have seen so far?'
      );
    }, 60000);
    ```
  </Accordion>

  <Accordion title="On first login after a release">
    ```javascript theme={"system"}
    if (currentUser.isFirstLoginAfterRelease) {
      $sleek.showPopup(
        'changelog',
        'We shipped something new since your last visit:'
      );
    }
    ```
  </Accordion>
</AccordionGroup>

<Warning>
  Avoid calling `showPopup()` on every page load. Overuse will train users to dismiss prompts without reading them, reducing response quality. Trigger popups based on meaningful events or session milestones.
</Warning>
