Skip to content

Pixel Place friend integration

Status

Active — integration guide for external sites that share the same Pixel Place board.

Description

Guide for connecting another website to your live Pixel Place API so both frontends read/write the same canvas in real time.

Integration steps

  1. Confirm the external site origin is added to PLACE_ALLOWED_ORIGINS.
  2. Fetch board config/state:
  3. GET /api/place/config
  4. GET /api/place/state
  5. Subscribe to SSE deltas:
  6. GET /api/place/events
  7. event name: place
  8. Submit draws:
  9. POST /api/place/pixels
  10. Keep a stable per-user userId in browser localStorage for cooldown/quota tracking.

Frontend implementation notes

  • Use one API_BASE consistently across all sites that should share the same board.
  • Initialize by loading config then state, then open SSE stream.
  • Handle API errors explicitly:
  • CORS errors: origin not allowlisted
  • Missing live updates: SSE blocked by network/proxy
  • Rejected draws: quota/cooldown reached, inspect retryAfterMs

What collaborators need

  1. The live API base URL
  2. Confirmation their origin is allowlisted
  3. Current board rule values from config (for UI text/timers)

Example values from raw guide

  • API base: https://canvas.kiefermenard.com
  • CORS example:
  • https://kiefermenard.com,https://yourfriendsite.com

Known issues

  • None documented in this wiki yet.

Raw sources

  • raw/FRIEND_CANVAS_INTEGRATION.md