2.0.1.
Move to the exact script URL
Earlier integrations commonly passed only a tracking origin:trackingDomain remain available for compatibility. verbose remains available as a deprecated alias for debug.
Remove duplicate loaders
Choose one installation path for each website surface:- Plain HTML keeps the exact raw script tag and does not install the package.
- JavaScript, React, and Next.js install
@bilyai/jsand letinit()load the script.
Correct page-view tracking
The installed browser script records the initialPageView. Remove any initial manual page-view call.
For later SPA routes, send the exact event name after navigation commits:
Use readiness only for verification
track() calls made before loading finishes are queued. Application event code does not need to await ready().
Use ready() for installation checks and diagnostics:
Review payload changes
Version 2.0:- Supports top-level
productspayloads. - Defaults an omitted product quantity to
1. - Preserves product
imageand clientuserGroupfields. - Preserves zero-valued totals, taxes, discounts, and shipping fees.
- Calculates an order total from product price and quantity when
order.totalis absent. - Adds
event_idandtswhen you omit them. - Accepts custom event strings while retaining known-event autocomplete.
Handle nullable tracking IDs
getBilyTrackingId() returns string | null. Update code that assumed a string:
null is expected during server rendering.
Import public types from the package root
Version 2.0 exports the complete public payload types:Move to current event names
Compatibility aliases continue to work, but new code should use current names:| Replace | With |
|---|---|
Pageview | PageView |
Add to Wishlist | Product Added to Wishlist |
Category Viewed | ViewCategory |
Remove from Cart | Product Removed From Cart |
Search | Products Searched |
Validate before release
- Confirm the exact script URL remains unchanged in the browser.
- Confirm one automatic initial
PageView. - Confirm one explicit event for each later SPA route.
- Trigger events before loading finishes and verify their delivery order.
- Test a load failure and the
ready()rejection path. - Test server rendering without
windowordocument. - Verify zero-valued order fields and optional product quantities.
- Search the browser bundle for credentials and private tokens.
Verification checklist
Validate the installation and event behavior before updating production.