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

@edge-base/admin

v0.2.6

Published

EdgeBase admin SDK — server-side client for user management, database admin, and analytics

Readme


@edge-base/admin is the trusted server-side SDK for EdgeBase.

Use it when you need:

  • Service Key authenticated access
  • server-side database operations that bypass access rules
  • admin user management
  • raw SQL
  • push and analytics from secure environments
  • server-to-server function calls

If code runs in a browser, use @edge-base/web instead. If code runs on the server but should act as the current signed-in user through cookies, use @edge-base/ssr.

EdgeBase is the open-source edge-native BaaS that runs on Edge, Docker, and Node.js.

This package is one part of the wider EdgeBase platform. For the full platform, CLI, Admin Dashboard, server runtime, docs, and all public SDKs, see the main repository: edge-base/edgebase.

Beta: the package is already usable, but some APIs may still evolve before general availability.

Documentation Map

For AI Coding Assistants

This package ships with an llms.txt file for AI-assisted server SDK usage.

You can find it:

  • after install: node_modules/@edge-base/admin/llms.txt
  • in the repository: llms.txt

Use it when you want an agent to:

  • keep Service Key logic on the server
  • choose between web, ssr, and admin
  • use the correct db(namespace, id?) and sql(...) signatures
  • avoid shipping privileged SDK code to the browser

Installation

npm install @edge-base/admin

Quick Start

import { createAdminClient } from '@edge-base/admin';

const admin = createAdminClient(process.env.EDGEBASE_URL!, {
  serviceKey: process.env.EDGEBASE_SERVICE_KEY,
});

const { items: posts } = await admin
  .db('app')
  .table('posts')
  .orderBy('createdAt', 'desc')
  .limit(20)
  .getList();

console.log(posts);

Inside EdgeBase App Functions, you can also rely on environment detection:

import { createAdminClient } from '@edge-base/admin';

const admin = createAdminClient();

Core API

Once you create an admin client, these are the main surfaces you will use:

  • admin.db(namespace, id?) Server-side database access
  • admin.auth Admin user management
  • admin.sql(...) Raw SQL execution
  • admin.storage Server-side storage access
  • admin.functions Call app functions from trusted code
  • admin.push Send push notifications
  • admin.analytics Query analytics and track server-side events
  • admin.kv(namespace), admin.d1(database), admin.vector(index) Access platform resources from trusted code

Database Access

type Post = {
  id: string;
  title: string;
  status: 'draft' | 'published';
};

const posts = admin.db('app').table<Post>('posts');

const result = await posts
  .where('status', '==', 'published')
  .orderBy('title', 'asc')
  .limit(50)
  .getList();

For instance databases, pass the instance id positionally:

admin.db('workspace', 'ws-123');
admin.db('user', 'user-123');

Read more: Database Admin SDK

Admin Auth

const created = await admin.auth.createUser({
  email: '[email protected]',
  password: 'secure-pass-123',
  displayName: 'June',
});

await admin.auth.setCustomClaims(created.id, {
  role: 'moderator',
});

const users = await admin.auth.listUsers({ limit: 20 });
console.log(users.users);

Read more: Admin Users

Raw SQL

sql() supports two forms:

const health = await admin.sql('select 1 as ok');

const docs = await admin.sql(
  'workspace',
  'ws-123',
  'select * from documents where status = ?',
  ['published'],
);

Push And Analytics

await admin.push.send('user-123', {
  title: 'Deployment finished',
  body: 'Your content is live.',
});

const overview = await admin.analytics.overview({ range: '7d' });
console.log(overview.summary.totalRequests);

Read more:

Choose The Right Package

| Package | Use it for | | --- | --- | | @edge-base/web | Browser and untrusted client code | | @edge-base/ssr | Server-side code acting as the current cookie-authenticated user | | @edge-base/admin | Trusted server-side code with Service Key access |

License

MIT