Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f4d7871
feat: Surveys 2.0 containers (card popover / bottom sheet, full viewp…
boehlerlukas Oct 6, 2026
b70f383
feat: Gleap.showSurvey options (format, fields, personalToken, contai…
boehlerlukas Oct 6, 2026
dce4cae
feat: survey-embed.js bundle for data-gleap-survey embeds
boehlerlukas Oct 6, 2026
3e02cc1
docs: Surveys 2.0 release notes
boehlerlukas Oct 6, 2026
348b8db
feat: survey lifecycle events and legacy survey chrome
boehlerlukas Oct 6, 2026
62dc6c3
feat: forward server resume state for survey reminders
boehlerlukas Oct 6, 2026
769264d
fix: full-screen survey covers the viewport (no 700px inner cap) and …
boehlerlukas Oct 6, 2026
690d226
feat: floating survey sheet on phones
boehlerlukas Oct 7, 2026
4617e3a
fix: keep the phone survey sheet above the on-screen keyboard
boehlerlukas Oct 7, 2026
0d32a0f
feat: survey-step-viewed event and optional survey analytics forwarding
boehlerlukas Oct 7, 2026
f3b637b
feat: relay survey-step-viewed and forward survey events to GA4/GTM/M…
boehlerlukas Oct 7, 2026
e78de39
fix: phone survey sheet tells the messenger the room above the keyboa…
boehlerlukas Oct 7, 2026
9e3f35a
fix: Surveys 2.0 completions track outbound-<id>-submitted like legac…
boehlerlukas Oct 7, 2026
4e521b1
feat: page surveys answer keys typed on the host page (keyboard option)
boehlerlukas Oct 7, 2026
9c3c74a
feat: survey card and phone sheet follow the survey's corners (survey…
boehlerlukas Oct 7, 2026
f6f5708
fix: survey sheet follows the survey's surface and light/dark; launch…
boehlerlukas Oct 7, 2026
ec28226
fix: survey page scrolls the frame's top into view when the messenger…
boehlerlukas Oct 7, 2026
a686d32
perf: survey sheet keyboard handler runs at most once per frame and d…
boehlerlukas Oct 7, 2026
c21245c
chore: version 19.2.0
boehlerlukas Oct 8, 2026
c1cdbb8
Merge remote-tracking branch 'origin/master' into feat/surveys-v2
boehlerlukas Oct 8, 2026
f969d30
chore: build 19.2.0
boehlerlukas Oct 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## Unreleased
## 19.2.0
Surveys 2.0: `Gleap.showSurvey(surveyId, options)` takes `{ format: 'card' | 'full' | 'page', fields, personalToken, container, resume }`; the old format strings (`'survey'`, `'survey_full'`, `'survey_web'`) keep working. A survey shown before the SDK is ready now opens once it is.
New survey containers: the card is a 348px corner popover with an enter animation and becomes a bottom sheet (handle, scrim, home-indicator inset) on phones; full screen covers the whole viewport and the survey draws its own background and close button (no more centred 640px card over a blurred backdrop); `page` renders inline in `container` (or `document.body`) and grows with the survey. Card and page surveys only appear once their height is known. Reduced motion is respected. Legacy surveys (not yet migrated) keep the previous card and full-screen look.
New events `survey-shown`, `survey-answered`, `survey-completed` and `survey-closed` (with `surveyId`, `version`, `responseId`, …); `outbound-sent` keeps firing as before.
New standalone `survey-embed.js` (~3 KB): `<div data-gleap-survey="ID" data-api-key="KEY" data-mode="inline|popup|tab">` loads the SDK on demand and shows the survey inline, as a popup or behind a side tab.
Fixed: inline banners did not show on pages whose `body` clips its overflow, the usual app-shell layout (`html, body { height: 100%; overflow: hidden }`). The banner sits in the body's top margin, which the body cut off, so only an empty strip appeared above the page. On such pages the banner now goes into the body's top padding (added to the page's own padding), which the body does not clip; with `box-sizing: border-box` the app also keeps fitting the viewport instead of losing the banner's height at the bottom. Pages that scroll normally and floating banners are unchanged.

## 19.1.1
Expand Down
2 changes: 1 addition & 1 deletion build/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/browser/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/cjs/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/embed/survey-embed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/esm/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/esm/index.mjs.map

Large diffs are not rendered by default.

73 changes: 72 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,78 @@ export namespace Gleap {
feedbackFlow: string,
showBackButton?: boolean
): void;
function showSurvey(surveyId: string, format?: string): void;
type SurveyFormat = "card" | "full" | "page";
interface ShowSurveyOptions {
/** card = corner popover (bottom sheet on phones), full = full screen, page = inline in `container`. Default: card. */
format?: SurveyFormat;
/** Values for the survey's hidden fields. */
fields?: Record<string, string>;
/** Signed personal-link token: attaches the response to that contact. */
personalToken?: string;
/** Page format: answer with the keyboard while focus is on the host page. */
keyboard?: boolean;
/** Element (or CSS selector) the page format renders into. Default: document.body. */
container?: HTMLElement | string;
/** Continue a started response where it was left. */
resume?: boolean;
}
/**
* Shows a survey. The legacy format strings ("survey", "survey_full", "survey_web") keep working.
*/
function showSurvey(
surveyId: string,
formatOrOptions?: "survey" | "survey_full" | "survey_web" | string | ShowSurveyOptions
): void;
/** Surveys 2.0 events (reported by the survey renderer; not fired for legacy surveys). */
interface SurveyShownEvent {
surveyId: string;
version: number;
format: SurveyFormat;
responseId: string;
/** true when a started response was continued (resume). */
resumed: boolean;
}
interface SurveyStepViewedEvent {
surveyId: string;
version: number;
responseId: string;
/** Zero-based position of the question in the survey. */
stepIndex: number;
/** Question (block) key. */
key: string;
[key: string]: any;
}
interface SurveyAnsweredEvent {
surveyId: string;
version: number;
responseId: string;
[key: string]: any;
}
interface SurveyCompletedEvent {
surveyId: string;
version: number;
responseId: string;
endingId: string;
/** Answers keyed by question key. */
answers: Record<string, any>;
}
interface SurveyClosedEvent {
surveyId: string;
version: number;
responseId?: string;
/** Response status when closed (e.g. "in_progress", "completed"); none when nothing was answered. */
status?: string;
}
/** The survey is visible. */
function on(event: "survey-shown", callback: (data: SurveyShownEvent) => void): void;
/** A question became visible. */
function on(event: "survey-step-viewed", callback: (data: SurveyStepViewedEvent) => void): void;
/** An answer was saved. */
function on(event: "survey-answered", callback: (data: SurveyAnsweredEvent) => void): void;
/** The last question was answered and an ending is shown. `outbound-sent` keeps firing as before. */
function on(event: "survey-completed", callback: (data: SurveyCompletedEvent) => void): void;
/** The survey was closed (by the user or after its ending). */
function on(event: "survey-closed", callback: (data: SurveyClosedEvent) => void): void;
function on(
event:
| "initialized"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "JavaScript and TypeScript SDK for Gleap, an Intercom alternative with AI customer support, live chat, in-app bug reporting and customer feedback.",
"name": "gleap",
"version": "19.1.1",
"version": "19.2.0",
"main": "build/cjs/index.js",
"module": "build/esm/index.mjs",
"exports": {
Expand Down
2 changes: 2 additions & 0 deletions published/19.2.0/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/19.2.0/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/19.2.0/survey-embed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/latest/survey-embed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading