コンテンツへスキップ
Fumadocs

Subscribe to Celestial Body Events

受信
/celestial-bodies/events
サーバー

Subscribe to events for all celestial bodies in the galaxy

Events related to all types of celestial bodies (planets, satellites, asteroids, comets).

This is a general channel for monitoring the entire galaxy's celestial activity.

認可

headerAuthorizationBearer <JWT>

JWT Bearer token authentication for WebSocket connections

クエリパラメーター

bodyType?string

Filter by celestial body type

値の場所"planet""satellite""asteroid""comet"
minHabitability?number

Filter by minimum habitability index

範囲0 <= value <= 1
コードサンプル
const socket = new WebSocket("wss://galaxy.scalar.com/celestial-bodies/events?api_key=YOUR_API_KEY");

socket.addEventListener("message", (event) => {
  console.log(event.data);
});

メッセージ