0099c56 Thanks @BrunoScheufler! - Connect: Reliability improvements#953 6ac90b5 Thanks @jpwilliams! - Fix possibility of silently failing when multiple versions of Zod are installed
Updated dependencies [a641cc2]:
#912 a641cc2 Thanks @jpwilliams! - Adds a fetch export from "inngest" to allow any library that accepts a Fetch API-compatible function to automatically turn any call into a durable step if used within the context of an Inngest Function.
By default, if called outside of the context of an Inngest Function (or within an existing step), it will fall back to using the global fetch, or a fallback of the user's choice.
// Basic use
import { fetch } from "inngest";
const api = new MyProductApi({ fetch });
// With a fallback
import { fetch } from "inngest";
const api = new MyProductApi({
fetch: fetch.config({
fallback: myCustomFetchFallback,
}),
});
// Remove the default fallback and error if called outside an Inngest Function
import { fetch } from "inngest";
const api = new MyProductApi({
fetch: fetch.config({
fallback: undefined,
}),
});
It's also available within a function as step.fetch.
inngest.createFunction(
{
id: "my-fn",
},
{
event: "my-event",
},
async ({ step }) => {
const api = new MyProductApi({ fetch: step.fetch });
},
);
#949 d18006d Thanks @jpwilliams! - useInngestSubscription() no longer accepts an app; always use a token when subscribing on the client
#949 d18006d Thanks @jpwilliams! - subscribe() call no longer accepts an app as the first parameter
One can be passed alongside other arguments, e.g.
subscribe({
app,
channel: "hello-world",
topics: ["messages"],
});
An app is still required if you are not using a token retrieved from getSubscriptionToken().
#949 d18006d Thanks @jpwilliams! - Public environment variables (such as NEXT_PUBLIC_*) are now also accessed when looking for Inngest during subscriptions
#949 d18006d Thanks @jpwilliams! - Environment variables are also now captured in Deno and Netlify
#944 54b860a Thanks @amh4r! - Use x-inngest-event-id-seed header instead of event idempotency ID
#937 c6e9131 Thanks @jpwilliams! - Normalize headers in "inngest/lambda" - mocked requests with non-lowercase headers are now handled
#945 4506581 Thanks @jpwilliams! - Bump resolveAfterPending() microtask shim count to 100, reducing parallel index warnings
3903aa7 Thanks @jpwilliams! - Add inngest/function.cancelled event to known internal schemasefd658c Thanks @anafilipadealmeida! - Update description for batchSize; pricing plans decide on max limits8e71cdd Thanks @jpwilliams! - fnId and runId in streamed messages are now optional8e71cdd Thanks @jpwilliams! - Fix bad parsing of some message typesabae7fc Thanks @jpwilliams! - Require runId when publishing realtime messagesdc00cbf Thanks @jpwilliams! - Fix connecting to production; avoid ws:// 301 redirect11fd15b Thanks @jpwilliams! - Export fastifyPlugin as a named export to resolve CJS<->ESM interop issues#919 ebeaaff Thanks @jpwilliams! - Add dependencyInjectionMiddleware(), allowing you to easily add data to function input
import { dependencyInjectionMiddleware } from "inngest";
const prisma = new Prisma();
const inngest = new Inngest({
id: "my-app",
middleware: [dependencyInjectionMiddleware({ prisma })],
});
3374187 Thanks @jpwilliams! - Error.cause can now be any unknown value, though we still attempt to recursively expand causes until we hit an unknown value#918 a305a15 Thanks @jpwilliams! - Add support for Temporal APIs.
inngest.createFunction(
{
id: "my-fn",
},
{
event: "test/hello.world",
},
async ({ event, step }) => {
// sleep with a `Temporal.Duration`
await step.sleep("😴", Temporal.Duration.from({ seconds: 10 }));
await step.sleep("😴", Temporal.Duration.from({ minutes: 5 }));
await step.sleep("😴", Temporal.Duration.from({ hours: 1 }));
// sleepUntil using a `Temporal.Instant` or `Temporal.ZonedDateTime`
await step.sleepUntil(
"😴",
Temporal.Instant.from("2025-03-19T12:00:00Z"),
);
await step.sleepUntil(
"😴",
Temporal.ZonedDateTime.from("2025-03-19T12:00[Europe/London]"),
);
// sleepUntil also works with relative time
const now = Temporal.Instant.from(event.user.createdAtISO);
await step.sleepUntil(
"😴",
now.add(Temporal.Duration.from({ minutes: 30 })),
);
},
);
#745 ff01cd2 Thanks @jpwilliams! - Fix rare body reuse when parsing failure returns from inngest.send() and step.sendEvent()
#916 ab835ee Thanks @BrunoScheufler! - - Connect: Allow supplying Inngest env as environment variable
#913 b090e27 Thanks @jpwilliams! - Export the version of the package
#921 374727f Thanks @BrunoScheufler! - connect: Include RunID in acks / sdk response
d184913 Thanks @jpwilliams! - Fix shouldOptimizeParallelism() error when attempting to serve functions using multiple versions of inngest#907 b283b22 Thanks @jpwilliams! - Remove stream.getIterator(); ReadableStream is iterable from Node 18+, which is our target
#907 b283b22 Thanks @jpwilliams! - Renamed stream.get*Stream() methods to be more explicit about what each chunk of the stream will contain:
stream.getStream() is now stream.getJsonStream()stream.getWebStream() is now stream.getEncodedStream() (making sure this isn't confused with generic Web APIs)#905 4ae971b Thanks @jpwilliams! - Add getWebStream(), used to generate a stream with Uint8Array encoding appropriate for use within a Response
#907 b283b22 Thanks @jpwilliams! - Fix typing of retrieving a Response-compatible stream to be ReadableStream<Uint8Array>
#907 b283b22 Thanks @jpwilliams! - Better handle backpressure when writing to many generated streams
9546be7 Thanks @jpwilliams! - Allow connecting to cloud/dev in @inngest/realtimee3c8dfe Thanks @jpwilliams! - Loosen InngestTestEngine's function typing, allowing for InngestFunctions from many different inngest versions to be passed#897 2f7c89c Thanks @jpwilliams! - Loosen react peer dependency
#897 2f7c89c Thanks @jpwilliams! - app is now optional when using useInngestSubscription()