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

@restackio/ai

v0.0.154

Published

## run locally

Downloads

1,190

Readme

#restack-libraries-ts

run locally

pnpm link --global

In example project

pnpm link --global @restackio/ai

Hide sensitive fields from the workflow UI

Wrap any value with Sensitive(...) to opt it into selective field encryption. The codec encrypts only the marked fields and leaves the rest of the payload plaintext, so the engine UI keeps showing useful debug context (email, ids, timestamps) while sensitive values render as opaque ciphertext for anyone without the key.

Engine-managed key (recommended)

When the engine is configured with RESTACK_ENGINE_PAYLOAD_KEY and RESTACK_API_BEARER_TOKEN (see the engine readme), the SDK auto-fetches the key during connect() and wires up the codec for you. Consumer services don't need any new env or codec construction:

import { Restack, Sensitive, unwrapSensitive } from "@restackio/ai";

const restack = new Restack({ engineId, apiKey, address, apiAddress });

// Caller side:
await restack.scheduleWorkflow({
  workflowName: "UserSignupWorkflow",
  workflowId,
  input: { email, password: Sensitive(password) },
});

// Workflow side:
type SignupInput = { email: string; password: ReturnType<typeof Sensitive<string>> };
export async function UserSignupWorkflow(input: SignupInput) {
  const password = unwrapSensitive(input.password);
  // ...
}

The SDK passes its apiKey as the bearer token when fetching the key. Engines that don't expose the key endpoint (older versions, or with the env unset) cause the SDK to silently fall back to no encryption — no deployment breakage.

In the engine UI, the password field renders as { "__restack_encrypted__": "v1", "alg": "AES-256-GCM", "iv": "...", "ct": "..." } instead of plaintext.

Consumer-managed key (advanced)

If you'd rather keep the key entirely out of the engine — e.g. each consumer service manages its own key in a KMS — pass a codec explicitly. This overrides the engine auto-wire:

import {
  Restack,
  SensitiveFieldsCodec,
  createAesGcmEncryption,
} from "@restackio/ai";

const key = Buffer.from(process.env.RESTACK_PAYLOAD_KEY!, "base64");
const restack = new Restack({
  engineId, apiKey, address, apiAddress,
  payloadCodecs: [new SensitiveFieldsCodec(createAesGcmEncryption(key))],
});

For non-AES backends (KMS, HSM, envelope encryption), provide your own SensitiveEncryption implementation instead of createAesGcmEncryption. The codec is algorithm-agnostic.