Embedded
Embedded mode runs a full local Hatchet engine as a sidecar process managed by your application. It needs no API token, no Docker, and no external services (by default the sidecar starts a bundled Postgres), which makes it a good fit for local development and CI.
import { HatchetEmbeddedClient } from "@hatchet-dev/typescript-sdk/v1/embedded";
const hatchet = await HatchetEmbeddedClient.init();
// ... register workers and run tasks as usual ...
await hatchet.stopEmbedded();See the embedded mode guide for setup and configuration details.
Hatchet Embedded Client
Entry point for embedded mode. init() starts a full local Hatchet engine and
returns a regular Hatchet client connected to it. No API token or Docker is needed.
See the embedded mode guide.
Methods
init()
Runs a full Hatchet engine locally via the hatchet-embedded sidecar (downloaded
on first use) and returns a client wired to it. No API token or Docker is needed,
which makes this a good fit for local development and CI. By default the sidecar
starts a bundled Postgres; pass databaseUrl to point it at your own instead.
See the embedded mode guide.
Parameters
| Parameter | Type | Description |
|---|---|---|
embeddedOpts? | EmbeddedOptions | Options for the embedded engine (version, ports, database, ...). |
config? | Omit<Partial<ClientConfig>, "middleware"> | Optional configuration overrides for the client. |
options? | HatchetClientOptions | Optional client options. |
axiosConfig? | AxiosRequestConfig<any> | Optional Axios configuration for HTTP requests. |
Returns
Promise<EmbeddedClient<T, U>>
A new Hatchet client instance connected to the embedded engine.
Interfaces
EmbeddedOptions
Options for the embedded engine sidecar. All fields are optional; by default the latest hatchet-embedded release is downloaded and started with a bundled Postgres.
Properties
EmbeddedSidecar
A running embedded engine sidecar and its connection details, as returned by
startEmbeddedSidecar.
Properties
Type Aliases
Embedded Client
type EmbeddedClient<T, U> = HatchetClient<T, U> & object;A HatchetClient connected to an embedded engine, extended with stopEmbedded.
Returned by HatchetEmbeddedClient.init.
Type Declaration
| Name | Type | Description |
|---|---|---|
stopEmbedded() | () => Promise<...> | Gracefully stops the embedded engine sidecar and resolves once it has fully exited, including its bundled Postgres. Call this before your process exits so the engine's shutdown output does not print after your program has returned. |
Functions
startEmbeddedSidecar()
Downloads (and caches) the hatchet-embedded sidecar binary, spawns it, and waits until the embedded engine is ready. The sidecar shuts down when this process exits. Use HatchetEmbeddedClient.init unless you need the raw connection details.
Parameters
| Parameter | Type |
|---|---|
opts | EmbeddedOptions |
Returns
Promise<EmbeddedSidecar>
stopEmbeddedSidecar()
Gracefully stops every sidecar started in this process by
HatchetEmbeddedClient.init() (or startEmbeddedSidecar) and resolves once
they have fully exited, including their bundled Postgres. Call this before
your process exits so the engine's shutdown output does not print after
your program has returned.
Returns
Promise<void>
Last updated on September 1, 2026