Debugging
When something does not behave as expected, start with SDK logging and a short checklist of common causes before escalating.
Debug mode
Pass debug: true in the tiun.init configuration to turn on console logging from the SDK. That helps you see initialization, event flow, and errors during development.
tiun.init({
snippetId: 'YOUR_SNIPPET_ID',
language: 'en', // 'en' | 'de' | 'fr'
debug: true,
});Disable or omit debug in your live builds if you prefer minimal client noise.
Common issues
Events not firing
SDK not initialized
Call tiun.init() before subscribing to events.
Checkout not opening
Wrong or stale product ID
Live and sandbox have separate catalogs — compare the ID to the dashboard view for the same environment your SDK uses (sandbox: true → sandbox toggle on).
Connect overlay not opening
SDK not initialized or wrong environment
Ensure tiun.init() has been called and the snippet is configured for a time-based product.
Sandbox payments not working
App and dashboard on different environments
Use sandbox snippet ID and p-test-... IDs with sandbox: true; confirm the dashboard Sandbox toggle is on while configuring test data.
User state not updating
Relying only on snapshot properties
Listen for userChange and update UI from the event payload.
productAccess missing a purchase after checkout
Reading tiun.user too early, or wrong environment
Listen for userChange with event: 'checkout' — the payload already contains the updated productAccess. Confirm you're checking a p-test-... ID against the sandbox environment.
Can't re-test a first purchase
The test customer already has access
Log out and check out with a fresh email — each email is a separate test customer. See resetting sandbox state.
Session not restoring
Different browser or cleared storage
Sessions are per browser; clearing cookies or site data clears the session.
Event reference
For the full list of events and payloads, see SDK events.
Support
If logs and the table above do not resolve the issue, contact support@tiun.io with steps to reproduce and, when possible, snippet ID and environment (sandbox or live).
Last updated
Was this helpful?

