Skip to main content

Welcome to Brook

Brook is a powerful real-time messaging SDK that provides fault-tolerant pub/sub functionality with automatic reconnection, message replay, and seamless React integration.

Key Features

Real-time Messaging

WebSocket-based pub/sub with instant message delivery

Fault Tolerant

Automatic reconnection with exponential backoff

Message Replay

Never miss a message with automatic replay

React Hooks

Seamless integration with React applications

TypeScript Support

Full TypeScript support with comprehensive types

Lightweight

Minimal bundle size for optimal performance

Quick Example

  • JavaScript
  • React
  • Browser/CDN
  • Go
  • cURL
import Brook from '@aptly-sdk/brook';

const client = new Brook({ apiKey: 'your-api-key' });
await client.connect();

const channel = client.realtime.channel('my-topic');

channel.stream((message, metadata) => {
  console.log('Received:', message);
});

await channel.publish({ text: 'Hello World!' });

SDK Guides

Why Brook?

Brook automatically handles connection failures with intelligent retry logic and exponential backoff. Your application stays resilient even in unstable network conditions.
Message replay ensures that when your client reconnects, it automatically receives all messages that were sent while offline. No data loss, guaranteed.
Simple, intuitive API that works seamlessly with vanilla JavaScript or React. Get started in minutes with comprehensive documentation and examples.
Built for scale with lightweight footprint, TypeScript support, and battle-tested reliability. Used by teams building real-time applications.

Use Cases

Brook is perfect for building:
  • Real-time chat applications
  • Live notifications and alerts
  • Collaborative editing tools
  • Live dashboards and analytics
  • Multiplayer game updates
  • IoT device communication
  • Live sports scores and updates

Get Started

1

Install the SDK

bash npm install @aptly-sdk/brook
2

Get Your API Key

3

Start Building

Follow our Getting Started guide to build your first real-time app

Community & Support