Guides
Launcher
The Hopscotch launcher is a floating help menu you can add to your app so users can quickly discover tours, announcements, chat, and other in-app actions.
What is the launcher?
The launcher is an optional widget that opens a menu of items you configure in Hopscotch.
Common use cases:
- Launch onboarding tours on demand
- Link to docs or support pages
- Show announcements and announcement feeds
- Open chat from your app
- Trigger custom app actions
Configure your launcher
- Go to your launcher settings in Hopscotch.
- Enable the launcher.
- Set position and appearance.
- Add one or more menu groups.
- Add menu items to each group.
You can choose where the launcher appears and customize style settings to match your app branding.
Menu item types
You can add different item types in the menu builder:
- Tour: Start a product tour
- Survey: Open a survey
- Custom link: Open a URL
- Chat: Open your configured chat provider
- Announcement feed: Show recent messages from a feed
- Announcement: Link to a specific announcement
- Custom JavaScript: Trigger a custom action in your app
Custom actions
Custom actions let you add a launcher button that triggers your own app logic.
A custom action includes:
- A required button label
- Optional inline JavaScript
- A unique
itemId
Add a custom action
- Open launcher Menu builder.
- Click Add item.
- Choose Custom JavaScript.
- Enter a button label.
- Optionally add JavaScript code.
- Save.
If possible, leave inline JavaScript empty and handle the click through an event listener in your app code.
Click event: hopscotch:executeCustomAction
When a custom action is clicked, Hopscotch dispatches a cancellable browser event:
window.addEventListener("hopscotch:executeCustomAction", (event) => {
const { itemId, code } = event.detail
console.log("Launcher action clicked", { itemId, code })
})
Event details:
| Field | Type | Description |
|---|---|---|
itemId | number | Unique ID of the clicked custom action |
code | string | undefined | Optional JavaScript configured for the action |
If inline code exists, Hopscotch runs it after dispatching this event. Call event.preventDefault() to stop default code execution.
window.addEventListener("hopscotch:executeCustomAction", (event) => {
const { itemId } = event.detail
if (itemId === 123) {
event.preventDefault()
openSupportWidget()
}
})
Recommended pattern
For most teams:
- Keep inline code empty.
- Handle all action logic in app code.
- Route behavior by
itemId.
This keeps launcher behavior versioned and testable in your codebase.
Security guidance
Custom JavaScript runs in your app's browser context. Use caution:
- Prefer event-listener handling over inline snippets
- Keep inline code minimal when used
- Never include secrets or tokens in action code
- Validate any external input used by handlers
Still have questions?
We are here to help. Don't hesitate to reach out by email any time.