跳至內容
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);
});

訊息