# RealtimeSubscription | @supabase/supabase-js
Documentation for @supabase/supabase-js

### Hierarchy

- RealtimeSubscription

## Index

### Constructors

- constructor

### Properties

- bindings
- joinPush
- joinedOnce
- params
- pushBuffer
- rejoinTimer
- socket
- state
- timeout
- topic

### Methods

- canPush
- isClosed
- isErrored
- isJoined
- isJoining
- isLeaving
- isMember
- joinRef
- off
- on
- onClose
- onError
- onMessage
- push
- rejoin
- rejoinUntilConnected
- replyEventName
- subscribe
- trigger
- unsubscribe
- updateJoinPayload

## Constructors

### constructor

- new RealtimeSubscription(topic: string, params: {}, socket: RealtimeClient ): RealtimeSubscription

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:18

  #### Parameters

  - ##### topic: string

  - ##### params: {}

    - ##### [key: string]: unknown

  - ##### socket: RealtimeClient

  #### Returns RealtimeSubscription

## Properties

### bindings

bindings: any[]

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:11

### joinPush

joinPush: default

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:15

### joinedOnce

joinedOnce: boolean

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:14

### params

params: {}

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:7

#### Type declaration

- ##### [key: string]: unknown

### pushBuffer

pushBuffer: default[]

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:17

### rejoinTimer

rejoinTimer: default

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:16

### socket

socket: RealtimeClient

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:10

### state

state: CHANNEL_STATES

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:13

### timeout

timeout: number

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:12

### topic

topic: string

- Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:6

## Methods

### canPush

- canPush(): boolean

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:27

  #### Returns boolean

### isClosed

- isClosed(): boolean

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:54

  #### Returns boolean

### isErrored

- isErrored(): boolean

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:55

  #### Returns boolean

### isJoined

- isJoined(): boolean

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:56

  #### Returns boolean

### isJoining

- isJoining(): boolean

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:57

  #### Returns boolean

### isLeaving

- isLeaving(): boolean

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:58

  #### Returns boolean

### isMember

- isMember(topic: string): boolean

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:49

  #### Parameters

  - ##### topic: string

  #### Returns boolean

### joinRef

- joinRef(): string

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:50

  #### Returns string

### off

- off(event: string): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:26

  #### Parameters

  - ##### event: string

  #### Returns void

### on

- on(event: string, callback: Function): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:25

  #### Parameters

  - ##### event: string

  - ##### callback: Function

  #### Returns void

### onClose

- onClose(callback: Function): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:23

  #### Parameters

  - ##### callback: Function

  #### Returns void

### onError

- onError(callback: Function): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:24

  #### Parameters

  - ##### callback: Function

  #### Returns void

### onMessage

- onMessage(event: string, payload: any, ref?: string): any

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:48

  Overridable message hook

  Receives all events for specialized message handling before dispatching to the channel callbacks. Must return the payload, modified or unmodified.

  #### Parameters

  - ##### event: string

  - ##### payload: any

  - ##### Optional ref: string

  #### Returns any

### push

- push(event: CHANNEL_EVENTS, payload: any, timeout?: number): default

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:28

  #### Parameters

  - ##### event: CHANNEL_EVENTS

  - ##### payload: any

  - ##### Optional timeout: number

  #### Returns default

### rejoin

- rejoin(timeout?: number): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:51

  #### Parameters

  - ##### Optional timeout: number

  #### Returns void

### rejoinUntilConnected

- rejoinUntilConnected(): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:21

  #### Returns void

### replyEventName

- replyEventName(ref: string): string

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:53

  #### Parameters

  - ##### ref: string

  #### Returns string

### subscribe

- subscribe(timeout?: number): default

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:22

  #### Parameters

  - ##### Optional timeout: number

  #### Returns default

### trigger

- trigger(event: string, payload?: any, ref?: string): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:52

  #### Parameters

  - ##### event: string

  - ##### Optional payload: any

  - ##### Optional ref: string

  #### Returns void

### unsubscribe

- unsubscribe(timeout?: number): default

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:41

  Leaves the channel

  Unsubscribes from server events, and instructs channel to terminate on server. Triggers onClose() hooks.

  To receive leave acknowledgements, use the a `receive` hook to bind to the server ack, ie: channel.unsubscribe().receive("ok", () => alert("left!") )

  #### Parameters

  - ##### Optional timeout: number

  #### Returns default

### updateJoinPayload

- updateJoinPayload(payload: {}): void

- - Defined in node_modules/@supabase/realtime-js/dist/module/RealtimeSubscription.d.ts:29

  #### Parameters

  - ##### payload: {}

    - ##### [key: string]: unknown

  #### Returns void

Generated using TypeDoc