ReferenceBridge APIs
BotBridgeOptions
Reference for `BotBridgeOptions`, exported as part of the public Shardwire surface.
interface exported from src/discord/types.ts.
Summary
Reference for BotBridgeOptions, exported as part of the public Shardwire surface.
Signature
export interface BotBridgeOptions {
token: string;
intents: readonly BotIntentName[];
/** `split` = current two-process bridge, `hybrid` = split + exposed discord.js client, `single-process` = in-process app bridge with no WebSocket transport. */
mode?: 'split' | 'hybrid' | 'single-process';
/** When true, exposes the underlying discord.js client via `bot.client()` for incremental migration. */
exposeClient?: boolean;
raw?: {
/** Enables `app.actions.runRaw(...)` (disabled by default). */
enabled?: boolean;
/** Allowed method paths. `'*'` allows all methods except blocked internals. */
allow?: '*' | readonly string[];
/** Explicitly deny method paths (applied after `allow`). */
deny?: readonly string[];
};
/** Bridge WebSocket server settings (required unless `mode: 'single-process'`). */
server?: {
port: number;
host?: string;
path?: string;
heartbeatMs?: number;
maxPayloadBytes?: number;
secrets: readonly BotBridgeSecret[];
/** Reject new TCP connections when authenticated client count reaches this cap (default: unlimited). */
maxConnections?: number;
/** Max concurrent action executions per bot process (default: 32). */
maxConcurrentActions?: number;
/** When the queue is full, fail fast with `SERVICE_UNAVAILABLE` (default: 5000). */
actionQueueTimeoutMs?: number;
/**
* Where `idempotencyKey` deduplication is scoped (default: `connection`).
* - `connection`: same WebSocket connection only (reconnect uses a new scope).
* - `secret`: same configured secret id across connections (useful for retries after reconnect).
*/
idempotencyScope?: 'connection' | 'secret';
/** TTL for idempotency cache entries in ms (default: 120000). */
idempotencyTtlMs?: number;
};
logger?: ShardwireLogger;
}