insightdive_sdk 0.7.0 copy "insightdive_sdk: ^0.7.0" to clipboard
insightdive_sdk: ^0.7.0 copied to clipboard

Flutter SDK for Insightdive in-app surveys. Modal bottom-sheet or inline widget — embed anywhere, stream lifecycle events, zero user identifiers.

Changelog #

0.7.0 — 2026-05-26 #

New — Operator context fields, respondent token, and contact opt-in support.

  • context: Map<String, dynamic>? — new optional field on InsightdiveConfig. Pass arbitrary key/value metadata (plan tier, feature flags, active surface, A/B cohort…) to be stamped on every submission. Serialised to JSON and forwarded via the postMessage bridge on ready. Validated server-side: max 20 keys, keys [a-z0-9_] max 64 chars, values string | number | boolean, total ≤ 4 KB. Invalid entries are silently dropped so the submission is never blocked.

  • respondentToken: String? — new optional field on InsightdiveConfig. Set to an opaque hash the operator computes client-side (e.g. sha256(userId + workspaceSalt)). Stored as-is by Insightdive; enables the operator to cross-reference responses with their own user records without Insightdive knowing the identity. Max 128 chars, [a-zA-Z0-9-_] only.

  • Contact opt-in question type — the survey page now supports a contact_opt_in question type. When included in a survey, the respondent can voluntarily provide a contact field (email, phone, or ticket reference). No SDK changes required — the question renders inside the survey iframe and the opt-in is handled entirely server-side. The SDK's postMessage bridge already forwards all question answers including opt-in data.

0.6.0 — 2026-05-23 #

New — Screenshot capture. When an insight enables screenshot collection, the SDK captures your app screen (via a RepaintBoundary keyed with Insightdive.screenshotBoundaryKey) just before the sheet opens and attaches it to the response. Wrap your app root in RepaintBoundary(key: Insightdive.screenshotBoundaryKey, child: …) to opt in; capture is skipped silently if the boundary isn't mounted. isAvailable() / trigger() now read the collectScreenshot flag from the status endpoint.

0.5.3 — 2026-05-20 #

Chore — republish under tag-based CI trigger; no functional changes vs 0.5.2.

0.5.2 — 2026-05-19 #

NewproductIdentifier targeting now enforced server-side.

  • The Flutter SDK already sent productIdentifier in the status URL since 0.3.0. The server now validates it against the targetingIdentifier field configured in Admin → Insight → Targeting. No SDK code changes required.

0.5.1 — 2026-05-19 #

Fix — compilation errors in trigger().

  • FeedbackResult early-return values in trigger() now include the required sessionId: null and submissionId: null fields.
  • Added context.mounted guard before calling show(context) after the async HTTP call (use_build_context_synchronously).

0.5.0 — 2026-05-19 #

Security — embed token exchange before opening the survey WebView.

  • show() (and trigger() via show()) now calls POST /api/v1/surveys/[slug]/embed-token with Authorization: Bearer <apiKey> before opening the bottom sheet. The WebView URL uses ?t=<token> (5-min signed JWT) instead of ?apiKey=. Falls back to ?apiKey= silently if the exchange fails.
  • InsightdiveSurvey widget gains an optional embedToken parameter. When constructing the widget directly (inline embed) you can pass a pre-fetched token; null falls back to the API key as before.

0.4.0 — 2026-05-19 #

Breakingconfigure() parameter renamed, Newtrigger() now routes by event name.

  • sdkToken parameter removed from configure() — replaced by apiKey (tenant-level key found in Admin → Settings → API). Update your call:

    // Before
    Insightdive.configure(tenant: 'acme', survey: 'onboarding', sdkToken: 'sdk_…');
    // After
    Insightdive.configure(tenant: 'acme', survey: 'onboarding', apiKey: 'ik_…');
    
  • trigger(context, eventName) now calls the status endpoint with ?event=<name> before deciding whether to open the sheet. If the insight's trigger-event list doesn't include the event, the call resolves silently as dismissed. When the list is empty every event matches. On network error the SDK falls through and opens the survey anyway (fail-open).

0.3.0 — 2026-05-15 #

New — inline widget embedding mode.

  • InsightdiveSurvey — a plain Flutter widget that renders the survey directly in your widget tree. Drop it inside a full-screen page, a card, a tab body, or any layout you control. The host decides when to mount and unmount it; react to FeedbackCompleted in onEvent to remove it:

    if (_showSurvey)
      InsightdiveSurvey(
        options: Insightdive.options,
        onEvent: (event) {
          if (event is FeedbackCompleted) {
            setState(() => _showSurvey = false);
          }
        },
      ),
    
  • Insightdive.options getter — returns the active FeedbackOptions set by configure(), throws StateError if called before configure.

  • Insightdive.addEvent(event) — manually pushes an event onto the global Insightdive.events stream, useful when using InsightdiveSurvey directly and you still want global stream subscribers to receive events.

  • Insightdive.isAvailable() — async check that hits the public GET /api/v1/surveys/{survey}/status endpoint. Returns true only when the survey is live. Call before mounting InsightdiveSurvey (or before show()) to avoid displaying a "not published" screen to end-users. Network errors return false — entry point stays hidden, never crashes.

  • Internal refactor: FeedbackSheet (modal) now delegates all webview logic to InsightdiveSurvey, eliminating duplicated code. No behaviour change.

0.2.1 — 2026-05-15 #

  • Replace product-specific example slugs in docs with generic acme/onboarding examples.
  • No API changes.

0.2.0 — 2026-05-13 #

Breaking — simplified configuration.

  • Insightdive.configure now takes tenant (workspace slug) + survey (project slug) instead of host (full URL) + deploymentId. The SDK builds https://<tenant>.insightdive.com/s/<survey> internally and resolves the active deployment server-side, so rotating a published survey no longer requires a SDK release.
  • New optional baseUrl for staging / self-hosted / local dev. When set it replaces the computed .insightdive.com host.
  • The synthesized FeedbackDismissed event now reports the deploymentId captured from earlier server events instead of echoing the (now-removed) configured value.

Migration #

// Before
Insightdive.configure(
  host: 'https://acme.insightdive.com',
  deploymentId: 'cmd_abc123',
);

// After
Insightdive.configure(
  tenant: 'acme',
  survey: 'onboarding',
);

0.1.0 — 2026-05-12 #

Initial release.

  • Insightdive.configure() for one-shot setup with host + deploymentId.
  • Insightdive.show(context) opens the survey as a modal bottom sheet.
  • Insightdive.events broadcasts ready, viewed, started, completed, dismissed lifecycle events.
  • Insightdive.trigger(context, eventName) alias of show — reserved for server-side event routing in a future release.
  • Insightdive.hide(context) closes the sheet programmatically.
  • Anonymous by default: no user identifiers are passed to the server.
  • iOS and Android supported via webview_flutter. Desktop/web bindings resolve when the host app pulls them in but are not validated yet.
0
likes
160
points
413
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for Insightdive in-app surveys. Modal bottom-sheet or inline widget — embed anywhere, stream lifecycle events, zero user identifiers.

Homepage
Repository (GitHub)
View/report issues

Topics

#feedback #survey #nps #csat #webview

License

MIT (license)

Dependencies

flutter, webview_flutter

More

Packages that depend on insightdive_sdk