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

@devjuanes/matuclient

v2.2.2

Published

Official JavaScript/TypeScript client for MatuDB — a Supabase-compatible local database platform (with Supabase fallback)

Readme

@devjuanes/matuclient

Official JavaScript/TypeScript client for MatuDB — a self-hosted, Supabase-compatible database platform.

Installation

npm install @devjuanes/matuclient

Or use locally (within the monorepo):

npm install ../matu-db-api/packages/matuclient

Configuration

The client can be configured manually or via environment variables.

Automatic Configuration (Environment Variables)

If you call createClient() without arguments, it will automatically look for these variables:

# MatuDB Backend URL
MATUDB_URL=http://localhost:3001

# MatuDB Project ID (Defaults to 'default')
MATUDB_PROJECT_ID=my-project

# MatuDB API Key (Anon or Service Role)
MATUDB_API_KEY=anon_xxxx...

# Supabase Fallback (Optional)
# Set to 'true' to route all calls through the official Supabase client
MATUDB_USE_SUPABASE=false

Manual Configuration

import { createClient } from '@devjuanes/matuclient';

const db = createClient({
  url: 'http://localhost:3001',
  projectId: 'my-project',
  apiKey: 'anon_xxxx',
  useSupabase: false // Set to true to use Supabase instead
});

Quick Start

import { createClient } from '@devjuanes/matuclient';

const db = createClient({
  url: 'http://localhost:3001',
  projectId: 'your-project-id',
  apiKey: 'your-anon-key',
});

API Reference

db.from(table) — Query Builder

Mirrors supabase.from() with a Supabase-compatible API.

// SELECT with filters
const { data, error } = await db
  .from('users')
  .select('id, name, email')
  .eq('active', true)
  .order('created_at', { ascending: false })
  .limit(10);

// Filter operators
.eq('col', value)       // =
.neq('col', value)      // !=
.gt('col', value)       // >
.gte('col', value)      // >=
.lt('col', value)       // <
.lte('col', value)      // <=
.like('col', '%patt%')  // LIKE
.ilike('col', '%patt%') // ILIKE (case-insensitive)
.in('col', [1, 2, 3])   // IN (...)
.is('col', null)        // IS NULL / IS TRUE / IS FALSE

// Single row
const { data: user } = await db.from('users').select('*').eq('id', userId).single();

// INSERT
const { data, error } = await db.from('products').insert({ name: 'Widget', price: 9.99 });

// INSERT multiple
const { data } = await db.from('products').insert([{ name: 'A' }, { name: 'B' }]);

// UPDATE
const { data } = await db.from('users').update({ name: 'Alice' }).eq('id', userId);

// DELETE
const { data } = await db.from('orders').delete().eq('id', orderId);

db.auth — Authentication

Mirrors supabase.auth.*.

// Sign up
const { data, error } = await db.auth.signUp({ email, password });

// Sign in
const { data, error } = await db.auth.signInWithPassword({ email, password });
// data = { user, session: { access_token, expires_at, user } }

// Sign out
await db.auth.signOut();

// Get current session
const { data: { session } } = await db.auth.getSession();

// Get current user
const { data: { user } } = await db.auth.getUser();

// Listen for auth changes
const { data: { subscription } } = db.auth.onAuthStateChange((event, session) => {
  console.log(event); // 'SIGNED_IN' | 'SIGNED_OUT'
});
// Cleanup:
subscription.unsubscribe();

db.storage — File Storage

Mirrors supabase.storage.*.

// Upload
const { data, error } = await db.storage.upload('avatar.png', file);

// Get public URL
const { data: { publicUrl } } = db.storage.getPublicUrl('avatar.png');

// List files
const { data: files } = await db.storage.list();

// Download
const { data: blob } = await db.storage.download('report.pdf');

// Delete
await db.storage.remove(['old-file.png', 'another.pdf']);

// Supabase bucket compat (bucket name is ignored):
await db.storage.from('avatars').upload('user.png', file);

db.channel() — Realtime

Mirrors supabase.channel().

// Supabase-compatible style
const channel = db
  .channel('public:users')
  .on('postgres_changes', { event: '*', schema: 'public', table: 'users' }, payload => {
    console.log('Change:', payload);
  })
  .subscribe();

// Short style
db.channel('orders')
  .on('INSERT', payload => console.log('New order:', payload.data))
  .on('DELETE', payload => console.log('Deleted:', payload.data))
  .subscribe();

// Cleanup
db.removeChannel(channel);
db.removeAllChannels();

db.rpc() — Raw SQL

const { data, error } = await db.rpc('SELECT * FROM users WHERE created_at > NOW() - INTERVAL \'7 days\'');

Migrating from Supabase

| Supabase | MatuDB | |---|---| | createClient(url, anonKey) | createClient({ url, projectId, apiKey }) | | supabase.from('t').select() | db.from('t').select() ✅ same | | supabase.auth.signInWithPassword() | db.auth.signInWithPassword() ✅ same | | supabase.storage.from('b').upload() | db.storage.upload() or .from('b').upload() ✅ | | supabase.channel('x').on(...) | db.channel('x').on(...) ✅ same | | supabase.rpc('fn', args) | db.rpc('SELECT ...') (raw SQL) |

All query responses return { data, error } — same as Supabase.