Overview
The Customer Account API handles customer registration, profile management, and social features including following other customers and stores. This system integrates with Clerk authentication to provide comprehensive user account management. Location:convex/customers/account.ts
Register Customer
Register a new customer or update existing customer preferences. New customers automatically get:- Auto-generated unique username
- Default private account (followers only)
- Profile ready for avatar upload
Update Customer Profile
Update the authenticated customer’s profile details.Avatar Management
Update Avatar
Upload and set a new avatar image for the customer.Remove Avatar
Remove the customer’s current avatar image.Username Management
Update Username
Change the customer’s username (must be unique).Check Username Availability
Check if a username is available and get suggestions.Search Customers by Username
Search for customers by their username.Privacy Controls
Update Privacy Setting
Change account privacy (private accounts show content only to followers).Get Customer Profile
Retrieve customer profile information for the authenticated user or a specific customer. Respects privacy settings - private accounts are only visible to followers.Get Customer Followings
Retrieve stores and customers that the authenticated user is following. Returns a plain object withstores and customers arrays (not paginated).
Get Customer Followers
Retrieve customers that follow the authenticated user. Returns a plain array of follower objects (not paginated).Customer Profile Component
Complete customer profile management:Customer Onboarding Flow
Complete onboarding process for new customers:Social Features
The account system includes social networking features:Follow Customers
Follow other customers to see their activity in your feed and discover new products through their interactions.
Follow Stores
Follow favorite stores to get notifications about new products, promotions, and special offers.
Activity Feed
See activity from followed customers and stores including new products, reviews, and recommendations.
Social Discovery
Discover new stores and products through your social network and trending content.
Privacy Settings
Customers can control their privacy preferences:Error Handling
Customer already registered
Customer already registered
Status Code:
200 (Success, returns existing customer)Invalid language preference
Invalid language preference
Status Code:
400Profile not found
Profile not found
Status Code:
404Customer registration is idempotent - calling it multiple times for the same user will update preferences rather than create duplicate accounts.
