> ## Documentation Index
> Fetch the complete documentation index at: https://opendonationassistant.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Подключение к STOMP

### Подключиться к топику с аутентификацией по токену

```javascript theme={null}
import { Client } from '@stomp/stompjs';

const client = new Client({
  brokerURL: 'ws://localhost:8080/ws',
  connectHeaders: {
    'passcode': 'your-auth-token-here',
  },
  onConnect: () => {
    client.subscribe('/topic/your-topic', message => {
      const data = JSON.parse(message.body);
      console.log('Received message:', data);
    });
  }
});

client.activate();
```
