#astro + solid-js

3 messages · Page 1 of 1 (latest)

junior chasm
#

Does convex work fine with astro + solid-js ?

gray ingotBOT
#

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

#

Yes, Convex can work with Astro + Solid, but there’s no Astro- or Solid-specific client in the docs today.

From the knowledge sources:

  • Convex provides generic JavaScript clients (ConvexClient and ConvexHttpClient) that work in “any JavaScript runtime that implements fetch or WebSocket,” not just React. [JS clients]
  • For frameworks without a dedicated client (Angular is given as an example), the recommended approach is to use the generic ConvexClient from convex/browser. [Angular thread; Node/JS client]

Astro + Solid can therefore use:

  • ConvexHttpClient for server-side (Astro server routes, SSR, scripts).
  • ConvexClient on the client side (Solid components) to subscribe to queries and run mutations.

What’s not in the sources:

  • There’s no official example or guide specifically for Astro or Solid.
  • There’s no Solid-specific hook API like useQuery for React documented here.

So: it should work fine using the generic JS clients, but you’d need to wire them into Solid’s reactivity yourself (e.g. wrapping onUpdate in Solid signals), since no Solid-specific helpers are documented in these sources.

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