# Documentation

Vask is a drop-in replacement for Pusher. Get started in minutes with your existing Pusher setup or explore our integration guides.

## Quick Start

1. **Create an account** - Sign up in the dashboard, import Pusher credentials, or let the agent skill register an app with your GitHub-published SSH key.
2. **Configure your application** - Use your Vask credentials with any Pusher SDK.
3. **Send messages** - Start broadcasting real-time events to your users.

## Integration Guides

- [Setup with agent](/docs/agent) - Install `vask-realtime` from skills.sh or use a copy-paste prompt for any AI agent to wire Vask into a Pusher-compatible stack.
- [Laravel](/docs/laravel) - Complete guide for Laravel Broadcasting with queues, channels, and events.
- [Channels](/docs/channels) - Public, private, presence, cache, and encrypted channel behavior.
- [Events](/docs/events) - Server events, client events, batch events, recipient exclusion, and subscription counts.
- [Authentication and signatures](/docs/authentication) - Channel authorization, user authentication, and HTTP API signing.
- [User authentication](/docs/user-authentication) - `pusher:signin`, `pusher:signin_success`, watchlists, and user-scoped features.
- [WebSocket protocol](/docs/websocket-protocol) - `wss://wss.vask.dev/app/{app_key}` frames and close codes.
- [HTTP API reference](/docs/http-api) - `https://api.vask.dev/apps/{app_key}/...` endpoints and request signing.
- [Cache channels](/docs/cache-channels) - Last-event replay and cache miss handling.
- [Encrypted channels](/docs/encrypted-channels) - End-to-end encrypted private channels.
- [Watchlist events](/docs/watchlist-events) - Online/offline updates for signed-in users.
- [User connections](/docs/user-connections) - Send events to users and terminate signed-in user connections.
- [Subscription count](/docs/subscription-count) - Live count events, API info responses, and webhooks.
- [Webhooks](/docs/webhooks) - Pusher-compatible webhooks for channel and presence events, with signing and retry details.
- **JavaScript** - Pure JavaScript integration without frameworks. _Coming soon._
- **PHP** - Server-side PHP integration guide. _Coming soon._

## Channels

Channels are the fundamental way to organize and filter data streams. Vask supports three types of channels:

- **Public channels** - Can be subscribed to by anyone who knows the channel name.
- **Private channels** - Require authentication and are prefixed with `private-`.
- **Presence channels** - Like private channels but also track who's online, prefixed with `presence-`.

## Events

Events are messages sent through channels to connected clients. Each event has:

- A **name** that identifies the type of message.
- Optional **data** payload (JSON).
- Automatic **metadata** like timestamps and socket IDs.

Events can be triggered from your server or directly from authenticated clients (client events).

## Limits

Vask accepts WebSocket message payloads up to 64KB per message. Messages larger than 64KB are rejected, so split larger data or send a reference to externally stored content.

## Authentication

Private and presence channels require authentication to ensure only authorized users can access sensitive data:

1. Client requests to subscribe to a private/presence channel.
2. Your server receives an authentication request at your configured endpoint.
3. You verify the user's permissions and return a signed token.
4. Client uses the token to complete the subscription.

Vask uses the same authentication mechanism as Pusher, making it fully compatible with existing auth endpoints.
