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 🙏

© 2025 – Pkg Stats / Ryan Hefner

convex-angular-resource

v0.0.0

Published

Angular + Convex, made simple. A tiny library that wraps the Convex client with Better Auth and gives you Angular Resources for live data, mutations, and actions.

Downloads

101

Readme

convNGX

Angular + Convex, made simple. A tiny library that wraps the Convex client with Better Auth and gives you Angular Resources for live data, mutations, and actions.

  • Zero-boilerplate DI setup
  • Live queries as Angular resources (keep-last, manual reload)
  • Mutations with optimistic updates, retries, and simple concurrency
  • Actions with the same ergonomics
  • Works with your Convex project and Better Auth out of the box

Demo app: projects/example-chat Docs: projects/convex-angular/README.md

Why convNGX?

Stop wiring clients and subscriptions by hand. Use Angular-native primitives that feel like Signals and Resources—because they are.

Assumptions

This library assumes your Convex backend uses Better Auth (via @convex-dev/better-auth) and exposes the Better Auth HTTP endpoints on your Convex site (e.g. https://YOUR.convex.site). The Angular provider handles token refresh automatically.

Get started (1 minute)

Install peer deps:

npm i convex @convex-dev/better-auth better-auth

Add the provider to your bootstrap:

import { bootstrapApplication } from '@angular/platform-browser';
import { provideConvexAngular } from '@convngx/angular';
import { AppComponent } from './app';

bootstrapApplication(AppComponent, {
  providers: [
    provideConvexAngular({
      convexUrl: 'https://YOUR.convex.cloud',
      authBaseURL: 'https://YOUR.convex.site',
    }),
  ],
});

Live queries: convexLiveResource

Angular Resource wrapper around Convex watchQuery with smart gating, keep-last, and manual reload, and smart Caching.

Core usage:

import { convexLiveResource } from 'convngx';
import { api } from '@/convex/_generated/api';

// Live updated with angular resource api
const todosRes = convexLiveResource(api.todos.list);
const todos = computed(() => this.todoRes.value())
const todoLoading = computed(() => this.todoRes.isLoading())

// With params (resource auto-disables when params() returns undefined)
const filter = signal('');

// Completly reactive! And cached!
const messagesRes = convexLiveResource(
  api.messages.getFilteredMessagesByContent,
  () => ({ content: filter() || undefined }),
);

// Opt out of keep-last value (immediate undefined on param change)
const resNoKeep = convexLiveResource(api.todos.list, { keep: 'none' });

// Manual refresh (also performs a one-shot .query to seed the latest value)
messagesRes.reload();

Built‑in auth state (stays in sync)

Get a reactive auth flag that updates automatically across tabs and refreshes tokens in the background. The example app exposes a tiny service using the provided client:

// app/state/convex-auth.state.ts
import { Injectable, computed, inject, signal } from '@angular/core';
import { CONVEX, type ConvexAngularClient } from '@convngx/angular';

@Injectable({ providedIn: 'root' })
export class ConvexAuthState {
  private readonly convex = inject<ConvexAngularClient>(CONVEX);
  private readonly _isAuthed = signal(this.convex.getAuthSnapshot().isAuthenticated);
  readonly isAuthenticated = computed(() => this._isAuthed());

  constructor() {
    this.convex.onAuth(s => this._isAuthed.set(s.isAuthenticated));
  }
}
  • Auto-refreshes tokens ahead of expiry
  • Cross-tab sync (open in multiple tabs and it just works)
  • isAuthenticated stays current without manual glue code

See the example: projects/example-chat/src/app/state/convex-auth.state.ts

Explore the example

Documentation

License

MIT