Skip to content

feat: Surveys 2.0 - #168

Open
boehlerlukas wants to merge 7 commits into
masterfrom
feat/surveys-v2
Open

boehlerlukas wants to merge 7 commits into
masterfrom
feat/surveys-v2

Conversation

@boehlerlukas

@boehlerlukas boehlerlukas commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Surveys 2.0: showSurvey options and new survey frames

  • Gleap.showSurvey(id, formatOrOptions): the old strings still work. The options are { format: 'card'|'full'|'page', fields, personalToken, container, resume }. A call made before the session is ready now waits for it.
  • Triggered surveys pass resume, resumeData and outboundAction to the Messenger-App.
  • Frames:
    • card: 348px popover with an 18px radius; a bottom sheet on phones;
    • full: the whole viewport, Typeform-style, with focus moved into the frame so keyboard shortcuts work right away;
    • page: an inline iframe that grows with its content.
  • When the Messenger-App sends survey-legacy, the frame switches back to the old look.
  • New events: survey-shown, survey-answered, survey-completed, survey-closed (typed in index.d.ts). outbound-sent is unchanged.
  • survey-embed.js (about 3 KB): <div data-gleap-survey data-api-key data-mode="inline|popup|tab">.

Verified: jest 505/505, npm run build, visual harness, and a full end-to-end run.

Build output is not committed; it ships with the next version commit. The survey page and embed need this release on sdk.gleap.io/latest.

Design: https://claude.ai/artifact/AnPuqYBjvmVxxgxHozHfi1 · Contract: SURVEYS_V2_SPEC.md (Gleap workspace)

Surveys 2.0 PRs (merge/deploy order: Server → Messenger-App → Frontend → JavaScript-SDK release → HelpCenterApp → MCP-server → docs):

  • Server: GleapSDK/Server#2011
  • Messenger-App: GleapSDK/Messenger-App#238
  • Frontend: GleapSDK/Frontend#2221
  • JavaScript-SDK: feat: Surveys 2.0 #168
  • HelpCenterApp: GleapSDK/HelpCenterApp#106
  • MCP-server: GleapSDK/MCP-server#69
  • Docs: GleapSDK/gleap-api-docs#57

🤖 Generated with Claude Code

boehlerlukas and others added 7 commits October 6, 2026 21:35
…ort, inline page)

Card: 348px corner popover with 18px radius and enter animation; on phones a
bottom sheet with handle, scrim and safe-area inset. Full: covers the viewport,
the messenger draws the background and close button. Page: inline frame in a
host container that follows the survey's height. Card and page surveys stay
invisible until the messenger reports their height. Safe-area insets are sent
to the messenger (survey-safe-area). Reduced motion respected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ner, resume)

Legacy format strings keep working. start-survey keeps `format` as the
messenger app mode (survey | survey_full | survey_web | survey_page) and adds
surveyFormat, fields, personalToken, resume, outboundAction and safeArea.
showSurvey before the session is ready opens once it is; an inline survey page
is never replaced by a triggered survey.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Handles the messenger's survey-legacy (back to the pre-2.0 card / centred
full-screen chrome) and survey-shown / survey-answered / survey-completed /
survey-closed, exposed as SDK events (typed in index.d.ts). survey-shown now
comes from the messenger only; outbound-sent stays on notify-event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…takes keyboard focus when shown by a trigger

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant