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.

Getting Started

Get up and running with Brook in under 5 minutes

Live Demo

See Brook in action with our interactive demo

Get API Key

Sign up and get your API key from the console

GitHub

View the source code and contribute

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

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

JavaScript SDK

Complete guide for vanilla JavaScript applications

Go SDK

Build real-time applications with Go

React SDK

Use Brook with React hooks and components

REST API

Publish messages using HTTP/REST endpoints

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

GitHub Issues

Report bugs and request features

Documentation

Read the full documentation