Skip to content

v1.3.0 - Strongly-Typed Events & Dev Mode Cron Control

Choose a tag to compare

@jmarbutt jmarbutt released this 13 Dec 18:24
· 18 commits to main since this release

What's New

🎯 Strongly-Typed Events (No More Magic Strings!)

Define events that know their own name:

public record OrderCreatedEvent : IInngestEventData
{
    public static string EventName => "shop/order.created";
    public required string OrderId { get; init; }
    public required decimal Amount { get; init; }
}

// Send with full type safety
await client.SendAsync(new OrderCreatedEvent { OrderId = "123", Amount = 99.99m });

Functions can auto-derive their trigger from the event type:

// NO [EventTrigger] needed - derived from OrderCreatedEvent.EventName!
[InngestFunction("order-handler")]
public class OrderHandler : IInngestFunction<OrderCreatedEvent> { ... }

🔧 DisableCronTriggersInDev Option

Prevent scheduled functions from running during local development:

builder.Services.AddInngest(options =>
{
    options.AppId = "my-app";
    options.DisableCronTriggersInDev = true;
});

Or via environment variable:

INNGEST_DISABLE_CRON_IN_DEV=true

🐛 Bug Fix

  • Fixed SendEventAsync payload format (now sends array instead of wrapped object)

New APIs

  • IInngestEventData - Interface for strongly-typed events
  • [InngestEvent("name")] - Attribute alternative for event naming
  • SendAsync<T>() - Type-safe event sending
  • SendManyAsync<T>() - Send multiple typed events
  • DisableCronTriggersInDev - Option to disable cron triggers in dev mode