2.0.2.
Preserve the exact tracking URL
Earlier integrations often passed only a tracking origin:trackingDomain remain available for compatibility. The deprecated verbose option remains an alias for debug.
Load Bily one way
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. Follow a framework guide when it reserves one script element for the SDK to reuse.
Send one page view per route
The browser script records the initialPageView automatically. Remove any manual call for that first view.
For every later SPA route, send the exact event name after navigation commits:
Let early events queue
The SDK queuestrack() calls made before loading finishes. Your event code does not need to await ready().
Use ready() only for installation checks and diagnostics:
Confirm payload behavior
Version 2.0 now:- 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 a nullable tracking ID
getBilyTrackingId() returns string | null. Update code that assumed a string:
null during server rendering.
Import types from the package root
Version 2.0 exports the complete public payload types:Adopt current event names
Compatibility aliases still work. Use current names for new code:
See the complete event name reference for every normalized alias.
Verify the upgrade
- Confirm the exact tracking 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
Confirm installation and event behavior before you update production.