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

@hirall/client

v1.0.0

Published

Official TypeScript/JavaScript client for Hirall - Backend-as-a-Service

Downloads

4

Readme

@hirall/client

Official TypeScript/JavaScript client for Hirall - Backend-as-a-Service

Installation

npm install @hirall/client
# or
yarn add @hirall/client
# or
pnpm add @hirall/client

Quick Start

import { createClient } from '@hirall/client';

const hirall = createClient(
  'https://your-project.hirall.io',
  'your-api-key'
);

// Query data
const { data, error } = await hirall.db
  .from('users')
  .select('*')
  .eq('status', 'active')
  .execute();

// Insert data
const { data: newUser } = await hirall.db
  .from('users')
  .insert({ name: 'John Doe', email: '[email protected]' });

// Upload file
const { data: file } = await hirall.storage
  .bucket('avatars')
  .upload('user-123.png', fileBlob);

// Authenticate
const { data: session } = await hirall.auth.signIn({
  email: '[email protected]',
  password: 'password123'
});

Features

  • Database: PostgreSQL queries with type-safe query builder
  • Authentication: Email/password, OAuth, magic links
  • Storage: File upload/download with signed URLs
  • Realtime: WebSocket subscriptions
  • Functions: Edge function invocation
  • AI: Embeddings, semantic search, chat
  • TypeScript: Full type safety
  • Multi-tenant: Project isolation built-in

API Reference

Database

// Select
const { data } = await hirall.db
  .from('posts')
  .select('id, title, author')
  .eq('published', true)
  .order('created_at', { ascending: false })
  .limit(10)
  .execute();

// Insert
const { data } = await hirall.db
  .from('posts')
  .insert({ title: 'Hello World', content: '...' });

// Update
const { data } = await hirall.db
  .from('posts')
  .eq('id', 123)
  .update({ title: 'Updated Title' });

// Delete
await hirall.db
  .from('posts')
  .eq('id', 123)
  .delete();

// Raw SQL
const { data } = await hirall.db.query(
  'SELECT * FROM posts WHERE id = $1',
  [123]
);

Authentication

// Sign up
const { data: session } = await hirall.auth.signUp({
  email: '[email protected]',
  password: 'secure-password'
});

// Sign in
const { data: session } = await hirall.auth.signIn({
  email: '[email protected]',
  password: 'secure-password'
});

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

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

// Listen to auth changes
const { data: subscription } = hirall.auth.onAuthStateChange((event) => {
  console.log('Auth event:', event);
});

Storage

// List buckets
const { data: buckets } = await hirall.storage.listBuckets();

// Create bucket
const { data: bucket } = await hirall.storage.createBucket('avatars', {
  public: true
});

// Upload file
const { data: file } = await hirall.storage
  .bucket('avatars')
  .upload('user-123.png', fileBlob);

// Download file
const { data: blob } = await hirall.storage
  .bucket('avatars')
  .download('user-123.png');

// Get signed URL
const { data: url } = await hirall.storage
  .bucket('avatars')
  .getSignedUrl('user-123.png', { expiresIn: 3600 });

// Delete file
await hirall.storage
  .bucket('avatars')
  .delete('user-123.png');

Realtime

// Subscribe to channel
const channel = hirall.realtime
  .channel('room-1')
  .on('message', (payload) => {
    console.log('New message:', payload);
  })
  .subscribe();

// Send message
channel.send('message', { text: 'Hello!' });

// Unsubscribe
channel.unsubscribe();

Functions

// Invoke function
const { data, error } = await hirall.functions.invoke('my-function', {
  body: { name: 'John' }
});

AI

// Generate embeddings
const { data } = await hirall.ai.generateEmbedding('Hello world');

// Semantic search
const { data: results } = await hirall.ai.semanticSearch('query', 10);

// Chat completion
const { data: response } = await hirall.ai.chat([
  { role: 'user', content: 'Hello!' }
]);

Error Handling

All methods return a response object with data and error:

const { data, error, status } = await hirall.db
  .from('users')
  .select('*')
  .execute();

if (error) {
  console.error('Error:', error.message);
  console.error('Code:', error.code);
} else {
  console.log('Data:', data);
}

TypeScript Support

Full TypeScript support with type inference:

interface User {
  id: number;
  name: string;
  email: string;
}

const { data } = await hirall.db
  .from<User>('users')
  .select('*')
  .execute();

// data is typed as User[]

License

MIT

Links