Functions
init(config)
Initialize the Toffee SDK. Returns a ToffeeInstance.
Returns:
ToffeeInstance
toffee.identify(properties)
Attach custom properties to the current session. Useful for associating detection data with your own user records.
toffee.getDetection()
Get the current detection result. Returns null if detection hasn’t run yet.
DetectionOutput | null
toffee.destroy()
Tear down the SDK. Flushes pending events, removes event listeners, and cleans up timers.
useEffect return, Vue onUnmounted).
identify(properties)
Module-level convenience function. Works the same as toffee.identify() but uses the most recently created instance.
getDetection()
Module-level convenience function. Works the same as toffee.getDetection().