#Broser Extenion + Convex

3 messages · Page 1 of 1 (latest)

slate briar
#

Can I hook convex queries and mutations into a chrome extension/browser plugin.

tidal prismBOT
#

Hi @slate briar. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes. You can use Convex from a browser extension.

  • Use the Convex JavaScript client (WebSocket-based) or the HTTP client from any JS runtime that supports WebSocket/fetch. The ConvexClient subscribes to queries and runs mutations; ConvexHttpClient runs one-off queries/actions. [Client JS; browser module]

  • Community reports say Plasmo-based Chrome extensions work “as expected” with Convex (and even with Clerk for auth). You’ll still need to declare permissions/allowed domains in your extension manifest as usual. [Plasmo thread]

Notes:

  • The ConvexClient does not include built-in optimistic updates; you can build on BaseConvexClient if you need more control. [ConvexClient; browser module]
  • If you need middleware-like composition, see convex-helpers “custom functions.” [Extending context]

In short: yes—instantiate ConvexClient or ConvexHttpClient in your extension background/service worker or UI script, ensure your manifest allows connecting to your Convex deployment URL, and call your queries/mutations normally. [Client JS; Plasmo thread]

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: