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

inngest-nestjs

v1.0.2

Published

NestJS integration library for Inngest with decorators and type-safe helpers

Downloads

22

Readme

inngest-nestjs

A modern, type-safe NestJS integration for Inngest. This library provides a seamless way to define, discover, and serve Inngest functions within your NestJS application using decorators and automatic middleware configuration.

Features

  • 🎯 Typed Decorators - Create decorators bound to your specific Inngest client for full event name autocompletion.
  • Automatic Discovery - Automatically finds and registers Inngest functions from your providers and controllers.
  • Middleware Integration - Automatically sets up the Inngest serve endpoint using NestJS Middleware.
  • 🛠️ Full NestJS Integration - Works with dependency injection, allowing you to use your services inside Inngest functions.

Installation

npm install inngest-nestjs

Quick Start

1. Define your Inngest Client and Decorators

Create a file (e.g., src/inngest/client.ts) to define your client with schemas and instantiate the typed decorators.

import { Inngest, EventSchemas } from 'inngest';
import { createInngestDecorators } from 'inngest-nestjs';

// 1. Define your event types
type Events = {
  "app/user.created": { data: { userId: string } };
  "job/hello.world": { data: { name: string } };
};

// 2. Create the Inngest client
export const inngest = new Inngest({
  id: 'my-nestjs-app',
  schemas: new EventSchemas().fromRecord<Events>(),
});

// 3. Export typed decorators
export const { Function, Trigger } = createInngestDecorators(inngest);

2. Register the Inngest Module

In your AppModule, import InngestModule and provide the client.

import { Module } from '@nestjs/common';
import { InngestModule } from 'inngest-nestjs';
import { inngest } from './inngest/client';

@Module({
  imports: [
    InngestModule.forRoot({
      client: inngest,
      path: '/api/inngest', // Optional: defaults to /api/inngest
    }),
  ],
})
export class AppModule {}

3. Create your first Inngest Function

Use the decorators you exported in step 1. Note that you can use standard NestJS dependency injection in your class.

import { Injectable } from '@nestjs/common';
import { Function, Trigger } from '../inngest/client';

@Injectable()
export class UserService {
  constructor(private readonly logger: MyLoggerService) {}

  @Function({ id: 'send-welcome-email' })
  @Trigger({ event: 'app/user.created' }) // Full autocompletion here!
  async sendWelcomeEmail(ctx: GetFunctionInput<typeof inngest, 'app/user.created'>) {
    const { userId } = ctx.event.data;
    
    await ctx.step.run('fetch-user-details', async () => {
      // Logic here
      this.logger.log(`Processing user ${userId}`);
    });
  }
}

4. Trigger Events

Inject the client elsewhere in your application to send events.

import { Injectable, Inject } from '@nestjs/common';
import { INNGEST_CLIENT } from 'inngest-nestjs';
import { Inngest } from 'inngest';

@Injectable()
export class AuthService {
  constructor(@Inject(INNGEST_CLIENT) private client: Inngest) {}

  async signup(email: string) {
    // ... logic
    await this.client.send({
      name: 'app/user.created',
      data: { userId: '123' },
    });
  }
}

Advanced Configuration

Module Options

| Option | Type | Description | | --- | --- | --- | | client | Inngest | Required. Your Inngest client instance. | | path | string | Optional. The path where the Inngest endpoint will be served. Defaults to /api/inngest. |

Serving via Middleware

The library automatically registers the serve handler from inngest/express as a middleware. This means:

  • You don't need to manually create a controller for Inngest.
  • You don't need to call app.register() or app.use() in your main.ts for Inngest specifically.
  • It works seamlessly with both Express and Fastify (via the compatibility layer).

Authors

License

MIT License