npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

convex-vue

v0.1.5

Published

Convex integration for Vue

Readme

convex-vue TypeScript heart icon

npm version npm downloads Codecov Bundlejs

Overview

convex-vue is a Vue.js integration library for Convex - the backend application platform with a built-in database.

Features

  • 👌 Supports Convex realtime queries
  • 🔄️ SSR and SSG support via suspense
  • 🎉 Optimistic updates for mutations

Usage

Install package

# npm
npm install convex-vue

# bun
bun add convex-vue

# pnpm
pnpm install convex-vue

Import and use

Convex Vue is a Vue 3 plugin. Simply add it to your Vue app and use the provided composables.

import { convexVue } from 'convex-vue'
import { createApp } from 'vue'
import App from './App.vue'

const app = createApp(App)

app.use(convexVue, {
  url: 'your-convex-deployment-url'
})

app.mount('#app')

Composables

useConvexClient

The useConvexClient composable provides access to the Convex client instance. You can use it to call Convex functions directly or implement custom logic.

import { useConvexClient } from 'convex-vue'

// In your component
const client = useConvexClient()

useConvexQuery

The useConvexQuery composable is used to fetch data from Convex. It automatically handles subscriptions and reactivity, so your components will update in real time when the data changes.
On the server, it will trigger a standard query (without subscription).

import { useConvexQuery } from 'convex-vue'
import { api } from '../convex/_generated/api'

// In your component or composable
const { data, isPending, error } = useConvexQuery(api.myModule.myQuery, { param: 'value' })

useConvexMutation

The useConvexMutation composable is used to call Convex mutations. It provides a function that you can call to trigger the mutation, and it automatically handles loading and error states.

import { useConvexMutation } from 'convex-vue'
import { api } from '../convex/_generated/api'
// In your component or composable
const { mutate, isPending, error } = useConvexMutation(api.myModule.myMutation)

async function handleClick() {
  // mutate returns a promise with an object that contains a result or error property
  const { result, error: mutationError } = mutate({ param: 'value' })
}

Suspense and SSR Support

By default when using useConvexQuery, the data property will be undefined until the query is complete.
By using the suspense function, you can await the result of the query. This is useful for server-side rendering (SSR)
and Static Site Generation (SSG) where you want to wait for the query to complete before rendering the component.

Convex subscriptions on the server are not supported. useConvexQuery therefore triggers a standard query.
If you await the suspense function, it will resolve when the query is complete or reject with an error.

// In your component or composable
const { data, suspense } = useConvexQuery(api.myModule.myQuery, { param: 'value' })

const result = await suspense()
// Now you can use the data or result
console.log(data)
console.log(result)

Either use the result of the suspense function like below, or simply use the data property.
The suspense function will only return the result once on server and client (like a normal promise).
The data property will be reactive and update when the query result changes on the client.
Recommended to use the data property for SSR support and realtime clientside updates.

License

License