Documentation
SDK Debugging
Turn on debug mode to see why a message rendered or did not render, then fix it fast.
Enable debugging
Pass debug: true in initSpryUi().
Snippetts
import { initSpryUi } from "https://spryui.com/sdk/v1/index.mjs";
const sdk = initSpryUi({
publicKey: "pk_live_your_public_key",
host: window.location.host,
apiBaseUrl: "https://spryui.com/api/sdk/v1",
debug: true,
});
What debug mode shows
- Console errors and warnings for config/event failures.
- An on-page debug overlay (
#spryui-debug). - On mobile, the overlay collapses into a floating toggle button by default.
- Total messages fetched, matched after targeting, and actually rendered.
- Rendered message IDs.
- Experiment assignment details: experiment name, selected variant, control flag.
How thorough is it?
It is runtime-thorough for delivery and targeting decisions, but not a full network inspector.
- Great for: why a message did or did not render, and which variant a user received.
- Good for: spotting token/config/event transport failures quickly.
- Not included: backend SQL traces or full request/response payload dumps.
Disable in production
Keep debug: false for normal production traffic to avoid extra console noise and overlay UI.