space-game/bjsEditorPlugin/src/services/pluginSupabase.ts
Michael Mainguy f73661c23b Add BabylonJS Editor plugin for level editing
Plugin features:
- Token-based authentication (user pastes token from website)
- Browse and load official levels
- Browse, load, and save personal levels
- Export current scene as level config JSON
- Import level config into Editor scene
- Editor script components for game objects (asteroid, ship, planet, etc.)
- Floating UI panel for quick access to tools
- Camera speed controls for editor navigation

Note: Uses public Supabase anon key (same as website client bundle)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 07:11:49 -06:00

15 lines
407 B
TypeScript

/**
* Lightweight Supabase client for plugin context
*/
import { createClient, SupabaseClient } from "@supabase/supabase-js";
import { PLUGIN_CONFIG } from "../config";
let client: SupabaseClient | null = null;
export function getSupabaseClient(): SupabaseClient {
if (!client) {
client = createClient(PLUGIN_CONFIG.SUPABASE_URL, PLUGIN_CONFIG.SUPABASE_ANON_KEY);
}
return client;
}