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

opg-sdk

v0.2.5

Published

OPG Developer SDK for AI apps, agents, uploads, async video tasks, and usage inspection.

Readme

opg-sdk

TypeScript SDK for OPG backend services.

import { createOpgClientFromLocalConfig } from "opg-sdk";

const opg = await createOpgClientFromLocalConfig();

const models = await opg.ai.models();

Local Login

npx -y @jamba/opg-cli init --base-url https://api.example.com
npx -y @jamba/opg-cli login
npx -y @jamba/opg-cli app create --name "Your App" --slug your-app
npx -y @jamba/opg-cli login --app your-app

createOpgClientFromLocalConfig() reads .opg/credentials.json, .opg/opg.config.json, .env.local, and environment variables.

Configuration

  • OPG_BASE_URL: Gateway base URL, for example https://api.example.com
  • OPG_APP_SLUG: App slug owned by the current tenant
  • OPG_API_KEY: Optional explicit Developer Grant (opg_dev_...) for CI or non-interactive server runtimes
  • OPG_PLATFORM_TOKEN: Platform admin JWT for global control-plane operations

Codex

Use @jamba/opg-cli to generate local config and install the Codex MCP bridge.

Global Platform Control Plane

Developer Grants are intentionally scoped by app and permission. To create apps or manage global providers, pass a platform admin token and use the platform client:

import { createOpgPlatformClient } from "opg-sdk";

const platform = createOpgPlatformClient({
  baseUrl: process.env.OPG_BASE_URL!,
  platformToken: process.env.OPG_PLATFORM_TOKEN!,
});

await platform.apps.create({
  name: "Demo App",
  slug: "demo",
});

await platform.runtimeSettings.update({
  api_base_url: "https://opg.example.com",
  cors_origins: ["https://opg.example.com"],
});

await platform.storageProviders.create({
  name: "Default OSS",
  provider_type: "s3",
  is_default: true,
  config: {
    endpoint: "https://s3.example.com",
    bucket: "opg-assets",
  },
});

createOpgClient() also exposes opg.platform for processes that need both app-scoped API calls and platform administration.

App Data Through Platform Admin

Reading or managing app data uses the platform token because these are admin operations over a tenant app:

const feedbacks = await platform.apps.feedbacks.list(appId, {
  status: "open",
  page: 1,
  page_size: 20,
});

const feedback = await platform.apps.feedbacks.get(appId, feedbackId);

await platform.apps.feedbacks.update(appId, feedbackId, {
  status: "in_progress",
  priority: "high",
});

await platform.apps.feedbacks.addComment(appId, feedbackId, {
  body: "已收到,正在处理",
  is_internal: false,
});

const users = await platform.apps.analytics.users(appId, { days: 30 });
const aiLogs = await platform.apps.aiUsage.logs(appId, { days: 7 });
const orders = await platform.apps.payments.orders(appId, { page: 1 });

Available app data namespaces include agents, feedbacks, analytics, aiUsage, payments, email, site, redeem, admins, schema, functions, workflows, blocks, and build.

Platform-wide namespaces include observability, tasks, developerAuthorizations, storageProviders, smtpProviders, integrationApiKeys, payments, sms, oauth, email, proxies, ai, and agents.

Database Workspace

Database operations are routed through the OPG backend. The SDK never exposes DATABASE_URL, and SQL is limited to the app-owned namespace returned by:

const db = await opg.database.manifest();
console.log(db.namespace);

await opg.database.execute({
  sql: `CREATE TABLE ${db.namespace}customers (id uuid PRIMARY KEY DEFAULT gen_random_uuid(), email text NOT NULL)`,
  dryRun: true,
});