Optionaloptions: ConvexReactClientOptionsGet the logger for this client.
The Logger for this client.
Return the address for this client, useful for creating a new client.
Not guaranteed to match the address with which this client was constructed: it may be canonicalized.
Execute an action function.
A promise of the action's result.
Clear the current authentication token if set.
Close any network handles associated with this client and stop all subscriptions.
Call this method when you're done with a ConvexReactClient to dispose of its sockets and resources.
A Promise fulfilled when the connection has been completely closed.
Get the current ConnectionState between the client and the Convex backend.
The ConnectionState with the Convex backend.
Execute a mutation function.
A server.FunctionReference for the public mutation to run.
A promise of the mutation's result.
OptionalonError: (error: Error) => unknownOptionalonError: (error: Error) => unknownIndicates likely future interest in a query subscription.
The implementation currently immediately subscribes to a query. In the future this method may prioritize some queries over others, fetch the query result without subscribing, or do nothing in slow network connections or high load scenarios.
To use this in a React component, call useQuery() and ignore the return value.
A query (function reference from an api object) and its args, plus an optional extendSubscriptionFor for how long to subscribe to the query.
Fetch a query result once.
Most application code should subscribe to queries instead, using the useQuery hook.
A promise of the query's result.
Set the authentication token to be used for subsequent queries and mutations.
fetchToken will be called automatically again if a token expires.
fetchToken should return null if the token cannot be retrieved, for example
when the user's rights were permanently revoked.
an async function returning the JWT-encoded OpenID Connect Identity Token
OptionalonChange: (isAuthenticated: boolean) => voida callback that will be called when the authentication status changes
OptionalonRefreshChange: (isRefreshing: boolean) => voida callback called with true when the socket is paused to fetch a replacement token after a server rejection, and false when refresh completes
Subscribe to the ConnectionState between the client and the Convex backend, calling a callback each time it changes.
Subscribed callbacks will be called when any part of ConnectionState changes. ConnectionState may grow in future versions (e.g. to provide a array of inflight requests) in which case callbacks would be called more frequently. ConnectionState may also lose properties in future versions as we figure out what information is most useful. As such this API is considered unstable.
An unsubscribe function to stop listening.
Construct a new Watch on a Convex query function.
Most application code should not call this method directly. Instead use the useQuery hook.
The act of creating a watch does nothing, a Watch is stateless.
The Watch object.
Convex React client adapted to Retree's Convex client interface.
Remarks
Use this client anywhere you would normally create a
ConvexReactClient, includingConvexProvider. Pass the same instance to RetreeBaseConvexNode/ConvexNodeclasses so Retree query nodes share Convex's React cache and clean up subscriptions through Retree observation.