コンテンツへスキップ
Fumadocs

Subscribe to Planet Events

受信
/planets/{planetId}/events
サーバー

Subscribe to real-time events for a specific planet

Real-time events related to specific planets. Subscribe to get notified about:

  • Planet creation and updates
  • Atmospheric changes
  • Discovery of new satellites
  • Cosmic events (explosions, collisions, etc.)
  • Image uploads and media updates

認可

headerAuthorizationBearer <JWT>

JWT Bearer token authentication for WebSocket connections

アドレスパラメーター

planetId*string

The ID of the planet

クエリパラメーター

includeHistory?boolean

Include historical events

デフォルトfalse
eventTypes?array<string>

Filter by specific event types

コードサンプル
const socket = new WebSocket("wss://galaxy.scalar.com/planets/{planetId}/events?api_key=YOUR_API_KEY");

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

メッセージ