@dypai-ai/client-sdk - v1.12.0
    Preparing search index...

    Interface UseRealtimeOptions<T>

    interface UseRealtimeOptions<T = any> {
        enabled?: boolean;
        event?: "DELETE" | "*" | "INSERT" | "UPDATE";
        filter?: Record<string, any>;
        onChange?: (change: RealtimeChange<T>) => void;
        onDelete?: (oldRecord: T) => void;
        onInsert?: (record: T) => void;
        onUpdate?: (record: T, oldRecord: T) => void;
        schema?: string;
    }

    Type Parameters

    • T = any
    Index

    Properties

    enabled?: boolean

    Disable the subscription (default: true)

    event?: "DELETE" | "*" | "INSERT" | "UPDATE"

    Events to listen for (default: all)

    filter?: Record<string, any>

    Filter changes by field values (e.g., { status: 'active' })

    onChange?: (change: RealtimeChange<T>) => void
    onDelete?: (oldRecord: T) => void
    onInsert?: (record: T) => void

    Called on every change

    onUpdate?: (record: T, oldRecord: T) => void
    schema?: string

    DB schema (default 'public'). Use 'system' for built-in tables like channel_messages so the engine applies the correct authorization.