Skip to main content
Version: 🚧 Canary

πŸ–ΌοΈ Avatar Blocks

Avatar blocks provide reusable building blocks for working with avatar objects across domains (e.g., user profiles, organizations). They focus on normalizing avatar objects for API responses and maintaining files in cloud storage via signed URLs.


🎯 Overview​

Avatar blocks are designed to:

  • Normalize avatar objects by converting storage objectId to a signed download URL
  • Integrate with file storage drivers for secure URL generation
  • Handle cleanup when avatars are replaced to prevent orphaned files

πŸ“¦ Block Types​

πŸ” Schemas​

JSON Schema definitions for avatar data validation:

  • avatarSchema: Base avatar object validation (objectId, type)

View Avatar Schema Blocks β†’

βš™οΈ Blocks​

Pure business logic functions for avatar operations:

  • normalizeAvatarOfOwner: Normalize a single owner’s avatar to signed URL
  • normalizeAvatarsOfOwners: Normalize a list of owners’ avatars
  • deleteAvatarIfReplaced: Delete old avatar file when a new one replaces it

View Avatar Blocks β†’