Skip API
Manage the "Don't show again" state persisted in localStorage.
The skip API manages the "Don't show again" flag. Access it through instance.skip.
Properties
| Property | Type | Description |
|---|---|---|
isSkipped | boolean | Whether the skip flag is currently set |
storageKey | string | Active storage key (from config or default) |
Methods
| Method | Description |
|---|---|
set(value) | Sets the skip flag and persists it. No-op when skip is disabled. |
clear() | Clears the persisted flag. Works even when skip is disabled. |
Usage
// Check if user chose to skip
if (instance.skip.isSkipped) {
console.log('User opted out of tours');
}
// Set manually
instance.skip.set(true);
// Clear (tour will replay next time)
instance.skip.clear();
// Read the storage key
console.log(instance.skip.storageKey); // e.g. "borda-skip"
Events
Skip state changes emit events:
import { BordaEvent } from '@retoo/borda';
instance.api.events.on(BordaEvent.ON_SKIP_CHANGE, () => {
console.log('Skip toggled:', instance.skip.isSkipped);
});
instance.api.events.on(BordaEvent.ON_SKIP_CLEAR, () => {
console.log('Skip cleared');
});