RTCForge API Reference v1.1.1
    Preparing search index...

    Variable ClientMessageSchemaConst

    ClientMessageSchema: ZodDiscriminatedUnion<
        [
            ZodObject<
                { data: ZodUnknown; to: ZodString; type: ZodLiteral<"signal"> },
                $strip,
            >,
            ZodObject<{ type: ZodLiteral<"pong"> }, $strip>,
            ZodObject<
                {
                    channel: ZodString;
                    data: ZodOptional<ZodUnknown>;
                    type: ZodLiteral<"broadcast">;
                },
                $strip,
            >,
        ],
        "type",
    > = ...

    Zod schema validating messages sent by clients to the server. A parsed value is a ClientMessage: a directed signal, a heartbeat pong, or a broadcast. Malformed inbound messages are rejected and surface as PeerEvent.Error.