@getuserfeedback/protocol
v0.3.0
Published
getuserfeedback widget protocol — host surface and (later) wire protocol
Maintainers
Readme
@getuserfeedback/protocol
Public contract surface for host integrations that load and control the getuserfeedback widget.
Lifecycle contract
This package defines the public shapes for:
- init-time widget configuration
- post-load widget commands
- host SDK types and settlement helpers
What hosts can do after init
After the widget has been initialized, a public host integration may:
- identify the current user with
identify - update consent with
configure({ consent }) - update theme with
configure({ colorScheme }) - update auth with
configure({ auth }) - open, prefetch, prerender, close, or reset flows
Identification
Public identification is already supported.
Use one of these public command shapes:
{ kind: "identify", userId, traits? }{ kind: "identify", traits }
identify is a post-init lifecycle operation. The public root contract does not currently accept identity inside init or configure.
Navigation updates
Explicit public navigation update commands are not part of the current public contract.
There is no public navigate, updatePage, or hostContextUpdated command in @getuserfeedback/protocol. Hosts should not invent private navigation bridges on top of internal loader or core commands.
Loader-driven integrations may still observe browser URL changes internally for targeting and telemetry, but that behavior is internal runtime behavior, not a stable public contract yet.
GTM and other adapters
Adapters built on top of this package should only bridge capabilities that exist in this public contract.
- Use
identifyonly because it is public and supported. - Keep consent and theme updates mapped to
configure. - Do not expose custom navigation-update fields until this package defines a public navigation contract.
