# @purista/amqpbridge API

Package for using a AMQP broker like rabbitMQ as event bridge.

---
Canonical: /handbook/api/modules/_purista_amqpbridge/
Format: Markdown for agents
---

Package for using a AMQP broker like rabbitMQ as event bridge.

Package: `@purista/amqpbridge`

## Signature

```typescript
@purista/amqpbridge
```

## Examples

```typescript
import { AmqpBridge } from '@purista/amqpbridge'

// create and init our eventbridge
  const eventBridge = new AmqpBridge()
  await eventBridge.start()
```

## Members

### Type Aliases

- `type AmqpBridgeConfig = void` — Configuration for AmqpBridge.
- `type Encoder = Record<string, EncoderFunctions>` — Map of content-type to codec implementation.
Example key: `application/json`.
- `type EncoderFunctions = void` — Encode/decode contract for one content-type codec.
- `type Encrypter = Record<string, EncryptFunctions>` — Map of content-encoding to encryption implementation.
Example key: `utf-8`.
- `type EncryptFunctions = void` — Encrypt/decrypt contract for one content-encoding implementation.
- `type PausedSubscriptionState = void` — Runtime pause metadata for a subscription consumer managed by the AMQP bridge.
- `type RegisteredSubscription = void` — Consumer registration tracked by the AMQP bridge for cleanup and retry handling.

### Variables

- `const puristaVersion: "3.0.1"` — The PURISTA package version embedded in the published runtime build.

### Functions

- `deserializeOtpFromAmqpHeader(logger: Logger, message: ConsumeMessage | null, encrypter: Encrypter, encoder: Encoder): Promise<Context | undefined>`
- `getDefaultConfig(): Complete<AmqpBridgeConfig> & { exchangeName: string; url: string }`
- `serializeOtpForAmqpHeader(header: Record<string, string | undefined>): Record<string, string | undefined>`

### Event bridge

- `class AmqpBridge` — EventBridge implementation for AMQP brokers such as RabbitMQ.
