The launcher is one way in. The SDK is the other, and it's how you connect Gleap to the help menu, empty states and error screens you already have. The examples are JavaScript. The mobile SDKs have most of the same calls; product tours, startAgent and setUrlHandler are web only.
Open and close
Gleap.open();
Gleap.close();
Gleap.isOpened(); // true / falseTo run without the floating launcher entirely, with your own button and nothing of Gleap's:
Gleap.showFeedbackButton(false);Open a specific place
Landing someone on the messenger home when you know what they want is a wasted click. Each of these opens straight to the point:
Gleap.openHelpCenter();
Gleap.openHelpCenterArticle("42");
Gleap.openHelpCenterCollection("7");
Gleap.searchHelpCenter("invoice");
Gleap.openConversations();
Gleap.startConversation();
Gleap.openNews();
Gleap.openFeatureRequests();
Gleap.openChecklists();Most take an optional showBackButton. Pass false when you're sending someone to one specific thing and a back button would only offer a place they never came from.
A help icon that runs searchHelpCenter with the current screen's name is a small change that answers a lot of questions before they're asked.
Start a flow
Gleap.startBot("WORKFLOW_ID");
Gleap.startClassicForm("bugreporting");
Gleap.startProductTour("TOUR_ID");
Gleap.startChecklist("CHECKLIST_ID");
Gleap.showSurvey("SURVEY_ID");This is how a tour starts after your own onboarding step rather than on a page rule, or a bug form opens from your error boundary with the failure already in context.
For AI:
Gleap.askAI("How do I export my data?");
Gleap.startAgent("AGENT_ID", {
initialQuestion: "How do I export my data?",
});Find the IDs
You rarely need to look an ID up by hand: the dashboard shows the ready-made call with the ID filled in.
Workflow: in the workflow's trigger settings, open Manually start this workflow.
Product tour: in the tour's settings, under Start the product tour by code. Checklists show the same kind of snippet.
Survey: on the survey's Share tab.
AI agent: open the agent's actions menu and choose Use in SDK.
Help center article: Share article shows the
openHelpCenterArticlecall.Forms: the built-in forms are
bugreportingandfeaturerequests; a custom form uses its own form key.
Give the ticket context
Set these before opening a form, and they land on whatever ticket gets created:
Gleap.setTicketAttribute("screen", "billing-settings");
Gleap.preFillForm({ subject: "Payment failed" });
Gleap.startClassicForm("bugreporting");Anything you can set here is something the customer doesn't have to type and an agent doesn't have to ask for.
React to what happens
Gleap.on("initialized", () => {
// safe to call other Gleap methods
});
Gleap.on("open", () => {});
Gleap.on("close", () => {});
Gleap.on("checklist-completed", (data) => {});Waiting for initialized matters when your code runs early. It's the fix for calls that appear to do nothing on first load.
Handle links yourself
Gleap.setUrlHandler((url, newTab) => {
// route internally instead of a full page load
});Worth doing in a single-page app, where the default behaviour would reload the page.