Configure an Inngest app by defining a first-class client module:

defmodule MyApp.Inngest do
  use Inngest.Client,
    id: "my-app",
    funcs: [
      MyApp.Functions.SendEmail,
      MyApp.Functions.SyncUser
    ]
end

Pass that client to your Plug or Phoenix router:

inngest("/api/inngest", client: MyApp.Inngest)

Client Options

OptionDescription
idRequired app identifier used for registration.
funcsFunction modules served by this client.
mode:cloud or :dev.
envInngest environment header value.
event_keyEvent key used for sending events.
signing_keySigning key used for request/API authentication.
signing_key_fallbackFallback signing key.
api_urlREST API origin.
event_urlEvent API origin.
register_urlRegistration API origin.
inngest_urlDev server metadata origin.
serve_originPublic origin serving the Inngest endpoint.
serve_pathPublic path serving the Inngest endpoint.
middlewareClient-level Inngest.Middleware entries.

Explicit client options take precedence over SDK environment variables. Environment variables fill missing client options, and defaults apply after both are absent.

Middleware

Client-level middleware runs before function-level middleware and follows the registration order declared in middleware.

defmodule MyApp.Inngest do
  use Inngest.Client,
    id: "my-app",
    funcs: [MyApp.Functions.SyncUser],
    middleware: [
      MyApp.Inngest.RequestLogger,
      {MyApp.Inngest.TenantMiddleware, header: "x-tenant-id"}
    ]
end

Function-level middleware is configured on Inngest.FnOpts:

@func %FnOpts{
  id: "sync-user",
  name: "Sync User",
  middleware: [MyApp.Inngest.FunctionAudit]
}

See Inngest.Middleware for the TypeScript-aligned on_register, transform_*, wrap_*, and on_* lifecycle hooks.

Environment Variables

Use environment variables for secrets and deploy-specific values:

VariableUsed For
INNGEST_EVENT_KEYEvent sending key.
INNGEST_SIGNING_KEYPrimary signing key.
INNGEST_SIGNING_KEY_FALLBACKFallback signing key.
INNGEST_ENVInngest environment header value.
INNGEST_DEVEnables dev mode or dev origin.
INNGEST_API_BASE_URLREST API origin.
INNGEST_EVENT_API_BASE_URLEvent API origin.
INNGEST_BASE_URLShared API/event origin fallback.
INNGEST_SERVE_ORIGINPublic origin for served functions.
INNGEST_SERVE_PATHPublic path for served functions.

Avoid committing event_key or signing keys into client modules. Prefer runtime environment variables for those values.