API Reference
Complete documentation for all GlowScript server actions and APIs.
Available APIs
Core Operations
| API | Description |
|---|---|
| Appointments | Manage client appointments, scheduling, and status |
| Scheduling | Provider schedules, blockouts, rooms, and equipment |
Revenue Features
| API | Description |
|---|---|
| Gift Cards | Gift card templates, purchases, and redemptions |
| Waitlist | Appointment waitlist management and notifications |
| Opportunities | CRM pipeline for leads and prospects |
Authentication
All API calls require authentication via Supabase. Include the user's JWT token in requests:
const supabase = createClient(url, anonKey)
await supabase.auth.signInWithPassword({ email, password })
// Client is now authenticated for all subsequent callsError Handling
All server actions return a consistent response format:
type ActionResponse<T> =
| { success: true; data: T }
| { success: false; error: string }Example usage:
const result = await createAppointment(data)
if (!result.success) {
console.error('Failed:', result.error)
return
}
console.log('Created:', result.data)Rate Limits
GlowScript uses Supabase's built-in rate limiting. For high-volume operations, consider:
- Batching requests where possible
- Using server-side actions for bulk operations
- Implementing client-side caching