Skip to content

feat: type the formbricks_debug event for on() - #60

Merged
Dhruwang merged 2 commits into
mainfrom
anshuman/formbricks-debug-event-type
Oct 21, 2026
Merged

Dhruwang merged 2 commits into
mainfrom
anshuman/formbricks-debug-event-type

Conversation

@pandeymangg

Copy link
Copy Markdown
Contributor

What & why

Was: formbricks.on("formbricks_debug", …) does not compile for @formbricks/js users. The wrapper's event map lists only the survey events, even though on() already forwards any name to the SDK.
Now: formbricks_debug is in the event map with an exported TFormbricksDebugEvent payload, so wrapper users can subscribe to debug mode's events (formbricks/formbricks#9655).

  • The payload is typed loosely on purpose (type, at, other keys unknown): its shape may change, so it is for debugging, not for building on.
  • Types only, no runtime change. No version bump; this ships with the next release.

Where to look

  • packages/js/src/types/formbricks.ts — the new event and its payload type.

Coverage

Behaviour Level Test
formbricks_debug subscribes through the wrapper, with its payload type unit (red on main) load-formbricks.test.ts › formbricks_debug passes through to the SDK, with its own payload type. On main it fails check-types (TS2345, TS2305)

Rerun: pnpm --filter @formbricks/js check-types && pnpm --filter @formbricks/js test

The event only fires against a server with formbricks/formbricks#9655 deployed, and only in debug mode (?formbricksDebug=true).

@pandeymangg
pandeymangg requested a review from Dhruwang October 19, 2026 14:51
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 937fb875-fe34-4529-b68e-0bd8f824d647
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ebug-event-type

# Conflicts:
#	packages/js/src/types/formbricks.ts
@sonarqubecloud

Copy link
Copy Markdown

@Dhruwang
Dhruwang added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 6899171 Oct 21, 2026
9 checks passed
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.

2 participants