interface · Node only

# RelayOptions

`@toip-tools/relay` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/relay/src/server.ts#L28)

Import:

```ts
import { type RelayOptions } from "@toip-tools/relay";
```

## Declaration

interface:

```ts
interface RelayOptions {
  port: number;
  dbPath: string;
  /** The URL clients use, e.g. wss://relay.example.com/v1. Defaults to ws://<host>:<port>/v1, or ws://localhost:<port>/v1 when bound to every interface. */
  publicUrl?: string;
  host?: string;
  log?: (line: string) => void;
  limits?: Partial<RelayLimits>;
  /** Called for every message the relay accepts: what an operator can see (sender, recipient, size, time), never the contents. */
  onStored?: (m: StoredMessage) => void;
}
```

## Properties

**`port` (required)**

`number`

**`dbPath` (required)**

`string`

**`publicUrl` (optional)**

`string | undefined`

The URL clients use, e.g. wss://relay.example.com/v1. Defaults to ws://:/v1, or ws://localhost:/v1 when bound to every interface.

**`host` (optional)**

`string | undefined`

**`log` (optional)**

`((line: string) => void) | undefined`

**`limits` (optional)**

`Partial<RelayLimits> | undefined`

**`onStored` (optional)**

`((m: StoredMessage) => void) | undefined`

Called for every message the relay accepts: what an operator can see (sender, recipient, size, time), never the contents.

[Usage guide](https://toip.tools/toolkit/relay/#usage) · [Error handling](https://toip.tools/toolkit/relay/#errors) · [All exports](https://toip.tools/toolkit/relay/api/)

---

This is the Markdown version of https://toip.tools/toolkit/relay/api/RelayOptions/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
