The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
delete the old description
abc38784c96e6e3d
diff --git a/apps/docs/docs/reference/javascript/protocol.mdx b/apps/docs/docs/reference/javascript/protocol.mdxdeleted file mode 100644index 84830f7be30..00000000000--- a/apps/docs/docs/reference/javascript/protocol.mdx+++ /dev/null@@ -1,152 +0,0 @@-----id: protocol-title: Realtime Protocol-description: Understanding Realtime Protocol-sidebar_label: Protocol------The Realtime Protocal is a set of message formats that you send and receive from the Realtime server.--## Connection--In the initial message, the client sends a message specifying the features that wants to use (Broadcase, Presence, Postgres Changes).--```typescript-{- "event": "phx_join",- "topic": string,- "payload": {- "config": {- "broadcast": {- "self": boolean- },- "presence": {- "key": string- },- "postgres_changes": [- {- "event": "*" | "INSERT" | "UPDATE" | "DELETE",- "schema": string,- "table": string,- "filter": string + '=' + "eq" | "neq" | "gt" | "gte" | "lt" | "lte" + '.' + string- }- ]- }- },- "ref": string-}-```--In response, the server sends the Postgres configuration with a unique ID. With this ID, the client should route incoming changes to the appropriate callback.--```typescript-{- "event": "phx_reply",- "topic": string,- "payload": {- "response": {- "postgres_changes": [- {- "id": number,- "event": "*" | "INSERT" | "UPDATE" | "DELETE",- "schema": string,- "table": string,- "filter": string + '=' + "eq" | "neq" | "gt" | "gte" | "lt" | "lte" + '.' + string- }- ]- },- "status": "ok" | "error"- },- "ref": string-}-```--## System messages--System message are used to inform a client about the status of the Postgres subscription. The `payload.status` indicates if the subscription successful or not.-The body of the `payload.message` can be "Subscribed to PostgreSQL" or "Subscribing to PostgreSQL failed" with subscription params.--```typescript-{- "event": "system",- "topic": string,- "payload":{- "channel": "any",- "extension": "postgres_changes",- "message": "Subscribed to PostgreSQL" | "Subscribing to PostgreSQL failed",- "status": "ok" | "error"- },- "ref": null,-}-```--## Heartbeat--The heartbeat message should be sent every 60 seconds to avoid a connection timeout.--```typescript-{- "event": "heartbeat",- "topic": "phoenix",- "payload": {},- "ref": string-}-```--## Access Token--To update the access token, you need to send to the server a message specifying a new token in the `payload.access_token` value.---```typescript-{- "event": "access_token",- "topic": string,- "payload":{- "access_token": string- },- "ref": string-}-```--## Postgres CDC message--Realtime sends a message with the following structure--```typescript-{- "event": "postgres_changes",- "topic": string,- "payload": {- "data": {- "columns": Array<{name: string, type: string}>,- "commit_timestamp": string,- "errors": null | string,- "old_record": {"id": number | string},- "record": {[key: string]: boolean | number | string | null},- "type": "*" | "INSERT" | "UPDATE" | "DELETE",- "schema": string,- "table": string- },- "ids": Array<number>- },- "ref": null-}-```--## Broadcast message--Structure of the broadcast event--```typescript-{- "event": "broadcast",- "topic": string,- "payload": {- "event": string,- "payload": {[key: string]: boolean | number | string | null | undefined},- "type": "broadcast"- },- "ref": null-}-```