Isomorphic JavaScript client for Supabase providing authentication, database, real-time, storage, and edge functions capabilities.
89
Build a real-time notification system that uses a custom WebSocket transport layer to connect to Supabase. This is useful when working in specialized environments (React Native, Cloudflare Workers, proxies) that need custom WebSocket implementations.
Your implementation must:
notifications table in the public schemaThe custom WebSocket transport should:
@generates
/**
* Configuration for the notification client
*/
export interface NotificationClientConfig {
supabaseUrl: string;
supabaseKey: string;
onNotification?: (eventType: string, data: any) => void;
onConnectionStatus?: (status: string) => void;
}
/**
* Creates a real-time notification client with custom WebSocket transport
* @param config - Configuration including Supabase URL, key, and callbacks
* @returns Object with methods to control the subscription
*/
export function createNotificationClient(config: NotificationClientConfig): {
subscribe: () => Promise<void>;
unsubscribe: () => Promise<void>;
isConnected: () => boolean;
};Provides real-time subscription capabilities with configurable WebSocket transport.
Install with Tessl CLI
npx tessl i tessl/npm-supabase--supabase-jsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10