API Reference

Complete reference for the Trenches API.

Available Endpoints

Quick Start

Authentication

> The Spray and Play API uses session-based authentication for most endpoints,

> with API key support for metrics and admin operations. JWT token authentication is planned for v2.

Authentication Methods

1. Session-Based Authentication (Default)

Most API endpoints use cookie-based sessions via Supabase Auth. The browser handles this automatically:

// Include credentials for all authenticated requests
const response = await fetch('/api/user', {
  cred...
Read full authentication docs →