Create a realtime server
Creating a realtime server needs the Realtime admin permission. You see the monthly estimate before you confirm, and you are billed hourly from then on.
Realtime is rolling out region by region. Where it is not offered yet, creating a server is refused with MANAGED_SERVICES_UNAVAILABLE; nothing is created or billed.
Create a server in the Dashboard
- Open a Managed service project, or create one, and choose Realtime.
- Enter a name: 3–48 lowercase letters, numbers and hyphens, starting with a letter. It becomes part of the hostname.
- Pick a size. The size sets how many clients can connect and how fast messages flow; you can resize later without a restart. See sizes and pricing.
- Optionally add a server API allowlist: the IPs that may call the server API with your app secret. Browsers and apps can always open WebSocket connections.
- Name the first app, for example
production. You can add more apps later. - Review the monthly estimate and choose Confirm and create. The server page follows each provisioning step.
Create a server with the CLI
hubfly realtime create quotes the monthly price, asks you to confirm and waits until the server is ready. The first app is named production unless you pass --app.
hubfly realtime create chat --size nano --project new
# In an existing managed project, from a script:
hubfly realtime create chat --size small --project my-services --app web --yes
hubfly realtime info chatConnection details
The server's Connect page shows everything your code needs. Sockets and the server API share one host on port 443 with TLS.
| Value | Example | Where it goes |
|---|---|---|
| Host / URL | chat-1a2b.rt.hubfly.app, https://chat-1a2b.rt.hubfly.app | Clients and servers |
| App id | 1000001 | Servers (Pusher's appId) |
| Key | 20 lowercase letters and digits | Clients and servers. It is public: browsers use it. |
| Secret | Shown once | Servers only. It signs channel access and server calls. |
hubfly realtime env prints the same values as environment variables. The secret is included only with --reveal, which is recorded in the activity log:
hubfly realtime env chat --format dotenv --reveal >> .env
hubfly realtime env chat --preset laravel --revealApps and keys
One server hosts up to 100 apps (production, staging, one per product). Each app has its own numeric id, keys, settings and webhooks, and changes apply live. App ids are never reused, even after an app is deleted. Manage them under Apps & keys or with the CLI:
hubfly realtime apps create chat staging --origins https://staging.example.com
hubfly realtime keys create chat --app staging # prints the new secret once
hubfly realtime keys rotate chat --app staging --grace 24h
hubfly realtime keys revoke chat <key> --app staging- Up to 10 keys per app. Each key has its own secret. Several active keys let you roll out a change without downtime.
- Rotate issues a new key and secret and keeps the old key working for a grace period (24 hours by default), then revokes it. Connected projects get the new values automatically; update anything else that uses the old key before the grace period ends.
- Revoke refuses the key immediately and closes its connections. An app always keeps at least one active key, and a revoked key is never issued again.
- Disable an app to refuse all its clients without deleting it. Delete stops its keys, removes its webhooks and the variables it wrote into connected projects.
App settings
Settings belong to an app and apply live, without a restart. Numeric limits can only lower what the server's size allows.
| Setting | Default | What it does |
|---|---|---|
| Allowed origins | Every origin | Websites that may open connections: https://host[:port], https://*.domain or http://localhost[:port], up to 50. Connections without an Origin header, such as native and server clients, are always allowed. |
| Client events | Off | Lets subscribed clients send client-… events on private and presence channels, such as typing indicators. 10 per second per connection by default. |
| Subscription count events | Off | Sends subscriber counts of non-presence channels to clients and the subscription_count webhook. |
| Require user authentication | Off | Closes connections that do not sign in within 30 seconds. |
| Limits | The size's values | Connections, message size and publishes per second can be lowered per app. Channels per connection and presence members per channel default to 100 (up to 1,000). |
| Channel history | Durable, 2 minutes, 100 messages | off, memory (lost on restart) or durable (kept on the server's volume). The time limit depends on the size; up to 1,000 messages per channel. |
| Sessions | 60 seconds | How long a dropped Hubfly space client keeps its connection id, subscriptions and buffered messages (up to 300 seconds). |
| Offline queue for user messages | Off | Keeps user messages for users with no connection and delivers them at their next sign-in: 1 minute to 24 hours, up to 1,000 messages per user. |
| End-to-end encryption policy | Optional | off, optional or required. See encryption. |
| Payload preview in the debug console | Off | Shows the first 1 KiB of messages in the debug console. Never for encrypted messages. |
hubfly realtime apps update chat production --client-events --history durable --history-ttl 10m
hubfly realtime apps update chat production --origins https://example.com,https://*.example.com --require-authConnect a Cell project
Connected projects writes an app's connection variables into a Cell project you can edit, so your apps on Hubfly space read them like any other environment variable. Choose a preset:
| Preset | Variables |
|---|---|
Hubfly space SDK (hubfly) | HUBFLY_REALTIME_URL, HUBFLY_REALTIME_APP_ID, HUBFLY_REALTIME_KEY, HUBFLY_REALTIME_SECRET (secret). With a public prefix (NEXT_PUBLIC_, VITE_ or PUBLIC_) also browser copies of the URL and key, never the secret. |
Laravel / Pusher (laravel) | BROADCAST_CONNECTION=pusher, PUSHER_APP_ID, PUSHER_APP_KEY, PUSHER_APP_SECRET (secret), PUSHER_HOST, PUSHER_PORT=443, PUSHER_SCHEME=https, PUSHER_APP_CLUSTER=mt1 and the VITE_PUSHER_* copies for Laravel Echo. |
hubfly realtime bind chat --to web --client-prefix NEXT_PUBLIC_
hubfly realtime bind chat --to shop --preset laravel --app production
hubfly realtime bind list chat
hubfly realtime bind remove chat <bindingId> # removes the variables it wrote; --keep-variables keeps them- Redeploy the app after connecting: running apps keep the variables they have until their next deploy.
- Key rotation rewrites the key and secret of the projects that use that key.
- Disconnecting, or deleting the app or server, removes only variables that still point at this server, so variables you repointed stay.
- Hubfly space never writes your end-to-end master keys (
HUBFLY_REALTIME_E2E_KEYS); set those yourself.
Connected projects receive the secret
Next steps
- Connect clients with pusher-js or
@hubfly/realtime. - Publish from your server.
- Using Laravel? Follow Laravel Broadcasting.