Skip to content

Instantly share code, notes, and snippets.

@OptimoDev
OptimoDev / _shared-apiLogger.ts
Created October 9, 2025 13:12
SnapStudy Edge Functions Refactoring
// supabase/functions/_shared/apiLogger.ts
import type { APILogData } from './types.ts';
import { createSupabaseClient } from './supabaseClient.ts';
import { calculateCost } from './pricing.ts';
/**
* Log API usage to database for tracking and billing
* This is non-blocking - failures won't affect the main function
*/