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

@hitl-sdk/resolver-inngest

v1.1.0

Published

Inngest binding for hitl.

Readme

@hitl-sdk/resolver-inngest

Inngest binding for hitl.

Install

npm install @hitl-sdk/resolver-inngest @hitl-sdk/hitl inngest

@hitl-sdk/hitl and inngest are peer dependencies.

Workflow side

Register hitl once; each export is an Inngest function you invoke with step.invoke:

// inngest/client.ts
import { Inngest } from "inngest";
import { createHitlInngestFunctions } from "@hitl-sdk/resolver-inngest";

export const inngest = new Inngest({ id: "my-app" });

export const { waitForHuman, requestHuman, notify } = createHitlInngestFunctions(inngest);

Include the hitl functions in your serve handler alongside your app functions:

// app/api/inngest/route.ts
import { serve } from "inngest/next";
import { inngest, waitForHuman, requestHuman, notify } from "@/inngest/client";
import { inboundLead } from "@/inngest/functions/inbound-lead";

export const { GET, POST } = serve({
  client: inngest,
  functions: [inboundLead, waitForHuman, requestHuman, notify],
});

Call hitl from your functions via step.invoke. Pull actions into a variable and assert the result so isResolved keeps action ids and feedback types:

// inngest/functions/inbound-lead.ts
import { actions, isResolved, type HumanResult } from "@hitl-sdk/hitl";
import { inngest, waitForHuman } from "../client";

export const inboundLead = inngest.createFunction(
  { id: "inbound-lead" },
  { event: "lead/inbound" },
  async ({ event, step }) => {
    const actionsDef = actions().approve().deny().build();

    const approval = (await step.invoke("approve-lead", {
      function: waitForHuman,
      data: {
        message: `Inbound lead: ${event.data.email}`,
        actions: actionsDef,
        timeout: "72h",
      },
    })) as HumanResult<typeof actionsDef>;

    if (!isResolved(approval, "approve")) return;
    // approval.feedbacks is typed for the approve action
  },
);

step.invoke crosses a JSON boundary, so TypeScript cannot infer HumanResult from inline data. The actionsDef variable ties input actions to the asserted result type.

Pass options such as url, secret, or event as the second argument to createHitlInngestFunctions if needed. Durable HTTP uses incrementing hitl-fetch-N step IDs inside each invoke target.

Typed event names and payloads are exported for EventSchemas:

import { EventSchemas, Inngest } from "inngest";
import {
  HITL_NOTIFY_EVENT,
  HITL_REQUEST_HUMAN_EVENT,
  HITL_RESUME_EVENT,
  HITL_WAIT_FOR_HUMAN_EVENT,
  type HitlInngestEvent,
  type HitlNotifyEvent,
  type HitlRequestHumanEvent,
  type HitlResumeEvent,
  type HitlWaitForHumanEvent,
  type HitlWaitForHumanEventData,
} from "@hitl-sdk/resolver-inngest";

type Events = {
  [HITL_WAIT_FOR_HUMAN_EVENT]: HitlWaitForHumanEvent;
  [HITL_REQUEST_HUMAN_EVENT]: HitlRequestHumanEvent;
  [HITL_NOTIFY_EVENT]: HitlNotifyEvent;
  [HITL_RESUME_EVENT]: HitlResumeEvent;
};

export const inngest = new Inngest({
  id: "my-app",
  schemas: new EventSchemas().fromRecord<Events>(),
});

Use HitlWaitForHumanEventData when wiring EventSchemas. For per-call action typing at invoke sites, prefer HumanResult<typeof actionsDef> as shown above.

Server side

// lib/hitl.ts
import { Hitl } from "@hitl-sdk/hitl";
import { InMemoryState } from "@hitl-sdk/hitl/state";
import { inngestResolver } from "@hitl-sdk/resolver-inngest";
import { inngest } from "@/inngest/client";

export const hitl = new Hitl({
  state: new InMemoryState(),
  resolver: inngestResolver({ client: inngest }),
});
// app/.well-known/hitl/v1/[[...path]]/route.ts  (Next.js example)
import { hitl } from "@/lib/hitl";

export const { POST } = hitl.routeHandlers;

The same Inngest app must serve the hitl HTTP routes and run the functions that invoke hitl.

Environment

| Variable | Where | Purpose | |---|---|---| | HITL_URL | Inngest function runtime | Base URL for step.run fetch calls to the hitl server | | HITL_SECRET | Inngest function runtime | Bearer token for the internal API (if configured) |

Advanced

For tests or a custom request step.run wrapper, use the lower-level client (not for app handlers — use step.invoke instead):

import { createInngestHitlClient, type InngestStep } from "@hitl-sdk/resolver-inngest";

export function createHitl(step: InngestStep) {
  return createInngestHitlClient({ step, url: "https://my-app.example" });
}

Implementation details: ARCHITECTURE.md.