feat: persist script feature toggles to backend

Features (scroll, 404, outbound, downloads, frustration, storage, ttl)
are saved to site.script_features JSONB column on every toggle change.
Values are read from the site object on load.
This commit is contained in:
Usman Baig
2026-03-22 15:31:45 +01:00
parent e626350f14
commit b7e92abb40
3 changed files with 38 additions and 11 deletions

View File

@@ -23,6 +23,8 @@ export interface Site {
hide_unknown_locations?: boolean
// Data retention (months); 0 = keep forever
data_retention_months?: number
// Script feature toggles
script_features?: Record<string, unknown>
is_verified?: boolean
created_at: string
updated_at: string
@@ -49,6 +51,8 @@ export interface UpdateSiteRequest {
collect_screen_resolution?: boolean
// Bot and noise filtering
filter_bots?: boolean
// Script feature toggles
script_features?: Record<string, unknown>
// Hide unknown locations from stats
hide_unknown_locations?: boolean
// Data retention (months); 0 = keep forever