CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-supabase--supabase-js

Isomorphic JavaScript client for Supabase providing authentication, database, real-time, storage, and edge functions capabilities.

89

0.95x
Overview
Eval results
Files

task.mdevals/scenario-5/

Notification Service Client

A service client library that sends various types of notifications through a remote API endpoint.

Capabilities

Send text notifications

  • It sends a simple text notification and returns success status @test
  • It handles errors when the notification service is unavailable @test

Send structured notifications

  • It sends a notification with structured data including title, body, and priority level @test
  • It sends a notification with nested user preference data @test

Retrieve notification status

  • It retrieves the delivery status of a previously sent notification @test

Implementation

@generates

API

/**
 * Creates a notification service client instance.
 *
 * @param serviceUrl - The base URL of the notification service
 * @param serviceKey - The API key for authentication
 * @returns A client instance with notification methods
 */
export function createNotificationClient(serviceUrl: string, serviceKey: string): NotificationClient;

/**
 * Notification client interface
 */
export interface NotificationClient {
  /**
   * Sends a text notification message.
   *
   * @param message - The text message to send
   * @returns Promise with success indicator and message ID
   */
  sendTextNotification(message: string): Promise<{ success: boolean; messageId?: string; error?: string }>;

  /**
   * Sends a structured notification with metadata.
   *
   * @param notification - Object containing title, body, priority, and optional metadata
   * @returns Promise with success indicator and message ID
   */
  sendStructuredNotification(notification: {
    title: string;
    body: string;
    priority: 'low' | 'medium' | 'high';
    metadata?: Record<string, any>;
  }): Promise<{ success: boolean; messageId?: string; error?: string }>;

  /**
   * Retrieves the delivery status of a notification.
   *
   * @param messageId - The ID of the notification to check
   * @returns Promise with status information
   */
  getNotificationStatus(messageId: string): Promise<{ status: string; error?: string }>;
}

Dependencies { .dependencies }

@supabase/supabase-js { .dependency }

Provides backend communication capabilities for the notification service.

Install with Tessl CLI

npx tessl i tessl/npm-supabase--supabase-js

tile.json