> ## Documentation Index
> Fetch the complete documentation index at: https://nestcrate.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# nestrs-outbox API

> Reference for OutboxModule, OutboxRelay, OutboxOptions, PublishFn, and store statuses.

Crate: [`nestrs-outbox`](https://docs.rs/nestrs-outbox/1.7.1) · Feature: `outbox` · Guide: [Outbox](https://nestcrate.dev/ecosystem/outbox.md)

```toml theme={null}
nestrs-outbox = "1.7.1"
```

## `OutboxModule::register`

Exports `OutboxRelay` and `OutboxOptions`.

## `OutboxRelay`

```rust theme={null}
pub fn from_options(opts: &OutboxOptions) -> Self
pub fn store(&self) -> SharedOutboxStore
pub async fn add(&self, topic: &str, payload: Value) -> OutboxMessage
pub async fn tick(&self, publish: &PublishFn)
```

`PublishFn` = `Arc<dyn Fn(String, Value) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send>> + Send + Sync>`.

## `OutboxOptions`

| Field | Default |
| - | - |
| `store` | `InMemoryOutboxStore` |
| `max_attempts` | 10 |
| `poll_interval` | 1s |
| `batch_size` | 32 |
| `allow_in_memory` | true |

## Statuses

`OutboxStatus`: pending → published | retry → dead letter after max attempts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.