@phoenixforgeos/sdk
v2.2.0
Published
Shared SDK for the PhoenixOS platform — Supabase client, VAD service, auth, and automation
Maintainers
Readme
PhoenixOS SDK (@phoenixforgeos/sdk)
Shared TypeScript SDK for the PhoenixOS platform. Provides authentication, Supabase client factory, VAD (Visual App Definition) services, and automation clients for all companion apps.
Installation
npm install @phoenixforgeos/sdkQuick Start
Supabase Client
import { createPhoenixClient } from '@phoenixforgeos/sdk';
const supabase = createPhoenixClient({
supabaseUrl: process.env.VITE_SUPABASE_URL!,
supabaseKey: process.env.VITE_SUPABASE_ANON_KEY!,
});Automation Client (VTMS-Aligned)
import { VTMSPhoenixClient, PlatformIntegrationService } from '@phoenixforgeos/sdk';
const client = new VTMSPhoenixClient({
supabaseUrl: 'https://your-project.supabase.co',
supabaseKey: 'your-anon-key',
companyId: 'your-company-id',
environment: 'dev',
appName: 'MyAutomationApp',
});
// Register as platform app
await client.registerAsPlatformApp();
// CRUD with VTMS table resolution
const flows = await client.listFlows();
const runs = await client.listRuns();Platform Integration
const platformService = new PlatformIntegrationService(
client.getSupabaseClient(),
'your-company-id',
);
// Create workflow from automation flow
const workflow = await platformService.createWorkflowFromFlow(flow);
// Send notifications via VTMS infrastructure
await platformService.sendVTMSNotification(
'automation_completed',
'Flow execution completed',
['[email protected]'],
);Exports
| Export | Description |
|---|---|
| createPhoenixClient | Supabase client factory |
| createPhoenixServiceClient | Service-role Supabase client |
| VADService | Visual App Definition service |
| AuthService | Authentication service |
| PhoenixClient | Automation client (direct table access) |
| VTMSPhoenixClient | Automation client (VTMS table resolution) |
| PlatformIntegrationService | Workflow, notification, and analytics integration |
Deprecated Exports (Backward Compatibility)
ValuuClient and VTMSValuuClient are re-exported as aliases for PhoenixClient and VTMSPhoenixClient. Migrate to the new names when convenient.
Architecture
- VTMS Integration: Virtual Table Management System for multi-tenant data isolation
- Company Isolation: All queries partitioned by
organization_idwith RLS - App Registration: SDK registers itself in the platform app marketplace
- Service Reuse: Leverages existing workflow engine, notifications, and analytics
Development
npm test # Run tests
npm run build # Build the package
npm run dev # Watch mode
npm run type-check # TypeScript checking
npm run lint # LintingLicense
MIT
