@dypai-ai/client-sdk - v1.12.0
DYPAI
GitHub
Preparing search index...
modules/realtime/RealtimeClient
RealtimeChannel
Class RealtimeChannel
Index
Constructors
constructor
Properties
topic
Methods
on
presence
State
send
subscribe
track
unsubscribe
untrack
Constructors
constructor
new
RealtimeChannel
(
topic
:
string
,
client
:
DypaiRealtimeClient
,
config
?:
ChannelConfig
,
)
:
RealtimeChannel
Parameters
topic
:
string
client
:
DypaiRealtimeClient
Optional
config
:
ChannelConfig
Returns
RealtimeChannel
Properties
Readonly
topic
topic
:
string
Methods
on
on
(
type
:
"postgres_changes"
,
filter
:
DbChangeFilter
,
callback
:
(
payload
:
any
)
=>
void
,
)
:
this
Parameters
type
:
"postgres_changes"
filter
:
DbChangeFilter
callback
:
(
payload
:
any
)
=>
void
Returns
this
on
(
type
:
"broadcast"
,
filter
:
BroadcastFilter
,
callback
:
(
payload
:
any
)
=>
void
,
)
:
this
Parameters
type
:
"broadcast"
filter
:
BroadcastFilter
callback
:
(
payload
:
any
)
=>
void
Returns
this
on
(
type
:
"presence"
,
filter
:
PresenceFilter
,
callback
:
(
payload
:
any
)
=>
void
,
)
:
this
Parameters
type
:
"presence"
filter
:
PresenceFilter
callback
:
(
payload
:
any
)
=>
void
Returns
this
presence
State
presenceState
()
:
Record
<
string
,
PresenceEntry
[]
>
Returns
Record
<
string
,
PresenceEntry
[]
>
send
send
(
args
:
{
event
:
string
;
payload
?:
any
;
type
:
"broadcast"
}
,
)
:
Promise
<
"error"
|
"ok"
|
"timed out"
>
Parameters
args
:
{
event
:
string
;
payload
?:
any
;
type
:
"broadcast"
}
Returns
Promise
<
"error"
|
"ok"
|
"timed out"
>
subscribe
subscribe
(
callback
?:
(
status
:
SubscribeState
,
err
?:
Error
)
=>
void
)
:
this
Parameters
Optional
callback
:
(
status
:
SubscribeState
,
err
?:
Error
)
=>
void
Returns
this
track
track
(
payload
:
Record
<
string
,
any
>
)
:
Promise
<
"error"
|
"ok"
>
Parameters
payload
:
Record
<
string
,
any
>
Returns
Promise
<
"error"
|
"ok"
>
unsubscribe
unsubscribe
()
:
Promise
<
"ok"
>
Returns
Promise
<
"ok"
>
untrack
untrack
()
:
Promise
<
"error"
|
"ok"
>
Returns
Promise
<
"error"
|
"ok"
>
Settings
Member Visibility
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
topic
Methods
on
presence
State
send
subscribe
track
unsubscribe
untrack
DYPAI
GitHub
@dypai-ai/client-sdk - v1.12.0
Loading...