
Convex Has a Free API That Gives You a Reactive Backend With Real-Time Sync
Convex is a reactive backend: define your schema and queries in TypeScript, get real-time updates in your frontend automatically. No WebSocket setup, no polling. Quick Start npm create convex@latest Define Schema // convex/schema.ts import { defineSchema , defineTable } from ' convex/server ' import { v } from ' convex/values ' export default defineSchema ({ messages : defineTable ({ author : v . string (), body : v . string (), }) }) Write Queries // convex/messages.ts import { query , mutation } from ' ./_generated/server ' import { v } from ' convex/values ' export const list = query ({ handler : async ( ctx ) => { return await ctx . db . query ( ' messages ' ). order ( ' desc ' ). take ( 50 ) } }) export const send = mutation ({ args : { author : v . string (), body : v . string () }, handler : async ( ctx , args ) => { await ctx . db . insert ( ' messages ' , args ) } }) Use in React (Real-Time!) import { useQuery , useMutation } from ' convex/react ' import { api } from ' ../conv
Continue reading on Dev.to React
Opens in a new tab


