Developer home
VISWOO DOCUMENTATION
Phone bridge
The bridge the public (phone) page uses to talk to the site (`viswoo-public.js`).
The bridge the public (phone) page uses to talk to the site (viswoo-public.js).
window.Viswoo.public: Every method returns a Promise.
Methods
Section titled “Methods”| Method | Permission | Description |
|---|---|---|
Viswoo.public.context(): Promise<PublicContext> |
— | Language and settings. |
Viswoo.public.call<T = unknown>(action: string, payload?: unknown): Promise<T> |
depends on the action | Server action (e.g. draw); limited per visitor per day, plugin.limit_reached when exceeded. |
Viswoo.public.report(name: string, count?: number): Promise<void> |
events |
Event counter. |
Viswoo.public.storage.get<T = unknown>(key: string): Promise<T | null> |
— | A value stored in this browser, or null. |
Viswoo.public.storage.set(key: string, value: unknown): Promise<void> |
— | Stores a small value (e.g. a won code). The frame has no localStorage of its own; the site stores it. Key [a-z0-9_.-]{1,40}, at most 4 KB. |
PublicContext
Section titled “PublicContext”Context of the phone page.
| Field | Type | Description |
|---|---|---|
code |
string |
|
language |
'tr' | 'en' |
The customer language. |
settings |
Record<string, unknown> |
The customer plugin settings (same as the screen; server-only fields are removed). |