Class: ConvexClient
browser.ConvexClient
Subscribes to Convex query functions and executes mutations and actions over a WebSocket.
Optimistic updates for mutations are not provided for this client. Third party clients may choose to wrap BaseConvexClient for additional control.
const client = new ConvexClient("https://happy-otter-123.convex.cloud");
const unsubscribe = client.onUpdate(api.messages.list, {}, (messages) => {
console.log(messages[0].body);
});
Constructors
constructor
• new ConvexClient(address
, options?
)
Construct a client and immediately initiate a WebSocket connection to the passed address.
Parameters
Name | Type |
---|---|
address | string |
options | ConvexClientOptions |
Defined in
Accessors
closed
• get
closed(): boolean
Once closed no registered callbacks will fire again.
Returns
boolean
Defined in
client
• get
client(): BaseConvexClient
Returns
Defined in
disabled
• get
disabled(): boolean
Returns
boolean