Isomorphic JavaScript client for Supabase providing authentication, database, real-time, storage, and edge functions capabilities.
89
Build a simple media gallery service that uploads images and generates publicly accessible URLs.
Your task is to implement a media gallery service that:
All images should be accessible via their public URLs without requiring authentication.
@generates
/**
* Uploads an image file to storage and returns its public URL
*
* @param fileName - The name to store the file as
* @param fileData - The file data as a Buffer
* @returns Object containing the file path and public URL
*/
export async function uploadImage(
fileName: string,
fileData: Buffer
): Promise<{ path: string; publicUrl: string }>;
/**
* Gets public URLs for multiple images in the gallery
*
* @param fileNames - Array of file names to get URLs for
* @returns Array of objects containing file names and their public URLs
*/
export async function getImageUrls(
fileNames: string[]
): Promise<Array<{ fileName: string; publicUrl: string }>>;Provides storage capabilities including file upload and public URL generation.
@satisfied-by
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