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

@oked/sdk

v0.3.6

Published

OKed SDK - human approval layer for AI agents

Readme

@oked/sdk

npm version License: MIT Types: included

Core library - programmatic approval API for AI agents. Sends sensitive actions to the OKed backend, waits for a human decision, and resolves only when the user approves or denies.

Use this package directly from any Node.js agent (OpenAI SDK, LangChain, custom). For drop-in integrations, see @oked/claude-code or @oked/openclaw.

Install

npm install @oked/sdk

Quick start

import { OKedClient } from "@oked/sdk";

const oked = new OKedClient({
  apiKey: process.env.OKED_API_KEY,
});

const result = await oked.approve({
  action: "deploy",
  description: "Deploy release 2026.04.07 to production",
  tier: "high_stakes",
  session_id: "deploy-123",
  cwd: process.cwd(),
});

if (!result.approved) {
  throw new Error(`Blocked by OKed: ${result.decision}`);
}

Configuration

Pass to new OKedClient(config):

| Key | Type | Default | Description | |---|---|---|---| | apiKey | string | OKED_API_KEY env | Your OKed API key. Required. | | backendUrl | string | https://api.oked.ai | Override the OKed backend URL. | | timeout | number | 300000 | Per-approval timeout in ms. | | strictFailClosed | boolean | false | When true, backend outages deny every tier. When false, outages deny only high_stakes and allow lower tiers. |

API

approve(request)

Request an approval for a sensitive action. Resolves when the user responds, the request times out, or the backend denies.

Request fields:

| Field | Type | Required | Description | |---|---|---|---| | action | string | yes | Short action identifier (e.g. "deploy", "send_email"). | | description | string | yes | Human-readable summary shown in the approval UI. | | tier | "safe" \| "warning" \| "review" \| "high_stakes" | yes | Risk tier. Use classify() if unsure. | | tool_input | unknown | no | Raw tool arguments, included in the audit log. | | session_id | string | no | Groups related approvals under one session. | | cwd | string | no | Working directory, shown in the UI for context. |

Response fields:

| Field | Type | Description | |---|---|---| | approved | boolean | true only when the user approved. | | approval_id | string | Opaque id for logs / audit. | | decision | "approved" \| "denied" \| "timeout" | Exact outcome. |

ping()

Returns true when the backend is reachable. Use for startup health checks.

Helpers

  • classify(input) - classifies a shell command or tool call into a risk tier.
  • describe(input) - generates a human-readable description for the approval UI.

Full type definitions ship with the package (dist/index.d.ts).

Environment

| Var | Required | Description | |---|---|---| | OKED_API_KEY | yes, unless passed in code | Your OKed API key. | | OKED_BACKEND_URL | no | Override the hosted backend URL. | | OKED_STRICT_FAIL_CLOSED | no | Set to 1 or true to deny every sensitive action when the backend is unreachable. |

Degraded-mode behavior

Explicit user denials return { approved: false } and should always be treated as final. Invalid API keys throw OKedAuthError and should deny. If the backend is unreachable, OKedBackendUnreachableError lets integrations apply degraded mode: high_stakes denies, while lower tiers may proceed unless strictFailClosed is enabled. Unexpected errors should be treated as deny.

Development

npm install
npm run build

License

MIT