공식 패키지 · 프레임워크
Axum과 Actix Web을 위한 실시간, 대기실, 채팅
Hibira crate는 이벤트를 보내고, 채널 구독과 웹훅에 서명·검증하고, Axum 또는 Actix Web 라우트 앞에 대기실을 두고, Chat API와 Approvals를 호출합니다.
hibiracrates.io ↗GitHub ↗
가장 빠른 방법: Hibira 플러그인과 프롬프트 하나
AI 코딩 에이전트에 플러그인을 설치하고 프롬프트를 붙여 넣으세요. 에이전트가 로그인하고, 필요하면 무료 앱을 만들고, 코드를 작성한 뒤 테스트 이벤트를 보냅니다. GitHub ↗
플러그인 설치
claude plugin marketplace add hibira-io/agent-plugin claude plugin install hibira@hibira이 프롬프트 붙여 넣기
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.
- Axum과 Actix Web용 대기실 미들웨어. 핸들러가 방문자의 패스를 받습니다.
- 비공개·presence 채널 인증, pusher-js 로그인, 웹훅 검증을 지원하며, client feature를 끄면 네트워크 코드가 포함되지 않습니다.
- 같은 crate에서 Chat API, Approvals, Live Chat 인증 방문자도 사용할 수 있습니다.
로그인하면 예제 코드에 내 클러스터 호스트가 채워집니다. 로그인
설치
cargo add hibira --features axum # or --features actix설정하기
HIBIRA_APP_ID=YOUR_APP_ID HIBIRA_KEY=YOUR_APP_KEY HIBIRA_SECRET=YOUR_APP_SECRET HIBIRA_HOST=ws.hibira.io사용하기
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));
시작하기 전에
- 앱 시크릿은 앱을 만들거나 시크릿을 교체할 때 한 번만 표시됩니다. 서버에만 두고, 브라우저나 게임 빌드에는 절대 넣지 마세요.
- 프라이빗 채널과 프레즌스 채널에는 pusher-js와 마찬가지로, 앱 시크릿으로 구독에 서명하는 인증 엔드포인트가 백엔드에 필요합니다.
대시보드의 앱 키를 사용하세요. 시크릿은 서버에만 둡니다. 채널, 이벤트, 인가 엔드포인트는 Pusher와 똑같이 동작합니다. 무료 계정 만들기 →