Official package · Frameworks

Realtime, waiting rooms and chat for Axum and Actix Web

The Hibira crate publishes events, signs channel subscriptions and webhooks, puts a waiting room in front of Axum or Actix Web routes, and calls the Chat API and Approvals.

crates.io versionLicense

Fastest way: one prompt with the Hibira plugin

Install the plugin in your AI coding agent and paste the prompt. The agent signs you in, creates a free app if you need one, writes the code and sends a test event. GitHub ↗

  1. Install the plugin

    claude plugin marketplace add hibira-io/agent-plugin
    claude plugin install hibira@hibira
  2. Paste this prompt

    Add Hibira Rust (hibira) to this project.
    Follow https://hibira.io/guides/rust, adapted to how this project is already set up.
    If I have no Hibira app yet, create a Free one that allows http://localhost so I can test right away.
    Keep the app key and secret in environment variables, add placeholders to .env.example, and never commit real values or send the secret to a browser.
    When you are done, send a test event, show me it arriving, and list the files you changed.

Prefer to do it by hand? These are the steps below:

  1. Install
  2. Set it up
  3. Use it

Other AI tools and what the plugin includes →

  • Waiting room middleware for Axum and Actix Web; the handler receives the visitor’s pass.
  • Channel auth for private and presence channels, pusher-js sign-in and webhook checks, with no network code when the client feature is off.
  • Chat API, Approvals and Live Chat verified visitors from the same crate.

Sign in to see these snippets with your own cluster host. Sign in

  1. Install

    cargo add hibira --features axum   # or --features actix
  2. Set it up

    HIBIRA_APP_ID=YOUR_APP_ID
    HIBIRA_KEY=YOUR_APP_KEY
    HIBIRA_SECRET=YOUR_APP_SECRET
    HIBIRA_HOST=ws.hibira.io
  3. Use it

    use std::sync::Arc;
    use axum::{middleware, routing::get, Extension, Router};
    use hibira::{waiting_room::axum_guard, Client, Config, Pass};
    
    let config = Config::from_env()?;
    let hibira = Client::new(config.clone());
    hibira.trigger(&["orders"], "order.shipped", &serde_json::json!({ "id": 1042 })).await?;
    
    let app = Router::new()
        .route("/drop", get(|Extension(pass): Extension<Pass>| async move { format!("You are number {}", pass.number) }))
        .layer(middleware::from_fn_with_state(Arc::new(config.waiting_room("presale")), axum_guard));

Before you start

  • The app secret is shown only once, when you create the app or rotate its secret. Keep it on your server, never in a browser or game build.
  • Private and presence channels need an auth endpoint on your backend that signs subscriptions with the app secret, as with pusher-js.

Use the app key from your dashboard; the secret stays on your server. Channels, events and authorization endpoints work exactly as they do with Pusher. Create your free account →