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

@lubes/sdk

v0.1.0

Published

Official TypeScript/JavaScript SDK for Lubes

Downloads

31

Readme

@agentbase/sdk

Official TypeScript/JavaScript SDK for AgentBase.

Installation

npm install @agentbase/sdk

Quick Start

import { AgentBase } from '@agentbase/sdk';

// Initialize with API key
const client = new AgentBase({
  apiKey: 'your-api-key',
  org: 'your-org',
  project: 'your-project',
});

// List tables
const tables = await client.listTables();
console.log(tables);

// Execute a query
const result = await client.executeQuery('SELECT * FROM users LIMIT 10');
console.log(result.rows);

Authentication

API Key Authentication

const client = new AgentBase({
  apiKey: 'ab_your_api_key_here',
  org: 'my-org',
  project: 'my-project',
});

Email/Password Authentication

const client = new AgentBase({
  apiUrl: 'https://api.agentbase.dev',
});

// Login
const { user, tokens } = await client.login({
  email: '[email protected]',
  password: 'password',
});

// Set org and project
client.setOrg('my-org').setProject('my-project');

Database Operations

List Tables

const tables = await client.listTables();

Get Table Schema

const schema = await client.getTableSchema('users');
console.log(schema.columns);

Execute Queries

// Simple query
const result = await client.executeQuery('SELECT * FROM users WHERE active = true');

// Parameterized query
const result = await client.executeQuery(
  'SELECT * FROM users WHERE email = $1',
  ['[email protected]']
);

Database Branches

// List branches
const branches = await client.listBranches();

// Create branch
const branch = await client.createBranch({ name: 'feature-branch' });

// Delete branch
await client.deleteBranch('feature-branch');

Functions

List Functions

const functions = await client.listFunctions();

Invoke Function

const result = await client.invokeFunction('my-function', {
  input: 'data',
});
console.log(result.result);

Function Logs

const logs = await client.getFunctionLogs('my-function', { limit: 50 });

Deployments

// List deployments
const deployments = await client.listDeployments();

// Create deployment
const deployment = await client.createDeployment({
  description: 'New feature release',
});

// Rollback
await client.rollbackDeployment(deploymentId);

Environment Variables

// List env vars
const envVars = await client.listEnvVars();

// Create env var
const envVar = await client.createEnvVar({
  key: 'API_KEY',
  value: 'secret-value',
  is_secret: true,
});

// Reveal secret value
const revealed = await client.revealEnvVar(envVar.id);

Storage

Buckets

// List buckets
const buckets = await client.listBuckets();

// Create bucket
const bucket = await client.createBucket({
  name: 'my-bucket',
  is_public: false,
});

Objects

// List objects
const objects = await client.listObjects(bucketId, {
  prefix: 'uploads/',
});

// Get signed URL for download
const { url } = await client.getSignedUrl(bucketId, {
  key: 'uploads/file.pdf',
  expires_in: 3600,
});

// Delete object
await client.deleteObject(bucketId, 'uploads/file.pdf');

Webhooks

// Create webhook
const webhook = await client.createWebhook({
  name: 'My Webhook',
  url: 'https://example.com/webhook',
  events: ['deployment.created', 'deployment.completed'],
});

// Get deliveries
const deliveries = await client.getWebhookDeliveries(webhook.id);

Organization Management

// List organizations
const orgs = await client.listOrganizations();

// Create organization
const org = await client.createOrganization({
  name: 'My Org',
  slug: 'my-org',
});

// Invite member
await client.inviteMember({
  email: '[email protected]',
  role: 'member',
});

Error Handling

import { AgentBase, AgentBaseError } from '@agentbase/sdk';

try {
  await client.executeQuery('INVALID SQL');
} catch (error) {
  if (error instanceof AgentBaseError) {
    console.error(`Error: ${error.code} - ${error.message}`);
    console.error('Details:', error.details);
  }
}

Configuration Options

const client = new AgentBase({
  apiUrl: 'https://api.agentbase.dev', // API URL (default)
  apiKey: 'your-api-key',              // API key authentication
  accessToken: 'jwt-token',            // JWT token authentication
  org: 'your-org',                     // Organization slug
  project: 'your-project',             // Project slug
  timeout: 30000,                      // Request timeout in ms (default: 30000)
});

TypeScript Support

Full TypeScript support with exported types:

import type {
  User,
  Organization,
  Project,
  TableSchema,
  QueryResult,
  ServerlessFunction,
  Deployment,
  EnvVar,
  Bucket,
  StorageObject,
  Webhook,
} from '@agentbase/sdk';

License

MIT