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

@agentpost-tools/identityhound-sdk

v0.5.1

Published

A typed HTTP client for identityhound, for servers and browsers, with its client workflows (`./workflows`), which use no UI framework, and the security notices an app builds from the change feed (`./notices`).

Readme

IdentityHound SDK

A typed client for IdentityHound's HTTP API, with sign-in, session, invitation, and workspace workflows. It runs in Node 24, browsers, and React Native wherever fetch is available.

npm i @agentpost-tools/identityhound-sdk

You need an Agentpost workspace and a project key for a project that uses IdentityHound. Read the project's config on your server with its secret key:

import { createClient } from '@agentpost-tools/identityhound-sdk';

export async function readConfig(key: string) {
  const identity = createClient({ token: key });
  const { config } = await identity.config.get();
  console.log(config.signUp.mode);
  return config;
}

Security notices

IdentityHound records each change in its change feed and sends no notice about it. @agentpost-tools/identityhound-sdk/notices turns a change into a notice your app chose to send, such as a new way to sign in, and reads the principal's verified addresses. You send it with your own mail:

import { createClient } from '@agentpost-tools/identityhound-sdk';
import {
  noticeRecipients,
  securityNotice,
} from '@agentpost-tools/identityhound-sdk/notices';

export async function sendNotices(
  key: string,
  after: number,
  sendEmail: (to: string, subject: string, text: string) => Promise<void>,
) {
  const identity = createClient({ token: key });
  const { events, next } = await identity.events.read({ after });
  for (const event of events) {
    const notice = securityNotice(event, {
      productName: 'Acme',
      notices: { identity_linked: true, api_key_created: true },
    });
    if (!notice) continue;
    for (const { to, message } of await noticeRecipients(identity, notice)) {
      const text = message.blocks
        .map((b) => (b.kind === 'text' ? b.text : ''))
        .join('\n');
      for (const address of to) await sendEmail(address, message.subject, text);
    }
  }
  return next;
}

IdentityHound SDK docs cover the client, workflows, and server helpers. Send security notices covers each notice and its wording.

On 0.x, changes that break existing calls, exports, types, or workflow behavior bump the minor version; other changes bump the patch.

Changelog

0.5.1. GrantsQueryInput has resourceType and resourceId, sent together, so grants.list can answer the grants on one resource, with or without entitlement. Only grants of an entitlement on exactly that resource match: a grant with no resource, or of a bundle, never does.

0.5.0. A project can allow one account per email:

  • IamConfig and ConfigUpdateInput have signUp.oneAccountPerEmail, a boolean every config update must send. Stored configs read false. With true, a sign-up whose verified email is already on another account answers account_exists, with the ways that account signs in in details.methods, such as email_code or oauth:twitch.
  • ErrorCode and ErrorDetails name account_exists, so IdentityhoundApiError narrows its details to { methods }. The email-code and OAuth workflows fail with account_exists too, with the same details, and emailCodeErrorMessage gives it words.

0.4.0. IdentityHound moved onto the API conventions every Agentpost service shares, and the types follow:

  • A change-feed event's data.context is { actor: { id }, onBehalfOf?: { id }, delegationId?, via }, the shape every Agentpost feed uses, instead of { actorId, onBehalfOfId?, delegationId?, via }. A feed reader reads context.actor.id and context.onBehalfOf?.id. Events already in the feed were moved to the new shape.
  • A stale If-Match on config.put answers stale_version where it answered version_conflict, and ErrorCode names stale_version and payload_too_large instead. A body over 1 MiB answers payload_too_large.
  • A refusal is kept and replayed with its Idempotency-Key for 24 hours, like a success, except throttled, guest_limit, provider_error, trusted_caller_required, and secret_key_invalid, which a retry runs fresh. Refusals of the request, the caller, or the moment are never replayed either: invalid_request, payload_too_large, unauthenticated, forbidden, idempotency_mismatch, conflict, cursor_expired, and internal_error. A key belongs to one operation, and is trimmed and at most 255 characters; a blank key is invalid_request. The query and If-Match are part of the request a key stands for, beside the path and body, so the same key with another query or If-Match answers idempotency_mismatch. A keyed request still running holds its key for 300 seconds, where it held it for 60; after that, a retry with the key takes it over and runs the request again.
  • If-Match is stricter: it takes the version you read, 3 or "3", of 1 or more. Anything else, such as 0, answers invalid_request, where it could answer version_conflict.
  • A JSON body that isn't an object, such as an array or a string, answers invalid_request. config.put and config.validate still report it as a config issue.
  • The config a project adopts with is stamped updatedBy: 'adopt', where it was 'system'.
  • events.read answers next past the events a types filter skipped, and trims each entry in types, so a, b reads as a,b.
  • An anonymous caller is refused with unauthenticated before an operation checks its fields or looks anything up, so on operations that need a signed-in caller it gets unauthenticated where it could get invalid_request, forbidden, trusted_caller_required, or not_found, and learns nothing about whether a record exists. That includes config.validate, which answered anyone and now needs a signed-in caller or your server, as its reference says.
  • IdentityhoundApiError narrows details by code: after error.code === 'cursor_expired', error.details is { oldest, latest }, and code_invalid, identity_in_use, throttled, merge_blocked, workspace_limit, and config_invalid have their documented details too. code is IdentityHound's codes, the Platform's, unknown, and oauth_failed, rather than any string, and ErrorDetails and ErrorDetailsOf name the types. IdentityhoundApiErrorCode, that set of codes, and IdentityhoundApiErrorConstructor, the type of IdentityhoundApiError itself, are newly exported. Code that compared code with a string outside those, or typed a narrowed details itself, may need to change.

Proprietary: use with Agentpost's hosted services under LICENSE.md.