Skip to main content

Overview

The Social Feed API provides social networking features including following customers and stores, activity feeds, product interactions, and social discovery. The feed respects privacy settings - private accounts only show content to followers. Location: convex/customers/feed.ts

Privacy Controls

The feed system respects customer privacy settings:
  • Private accounts (default): Content only visible to followers
  • Public accounts: Content visible to all users
  • Users can always see their own content regardless of privacy settings

Follow Customer

followerCustomerId
Id<'customers'>
required
Customer doing the following
targetCustomerId
Id<'customers'>
required
Customer to follow

Follow Store

followerCustomerId
Id<'customers'>
required
Customer following the store
storeId
Id<'stores'>
required
Store to follow

Like Product

productId
Id<'products'>
required
Product to like
customerId
Id<'customers'>
required
Customer ID

Get Feed

Retrieve personalized product-focused activity feed for a customer. The feed respects privacy settings and only shows content the user is authorized to see. Uses custom cursor-based pagination where the cursor is a timestamp string.
customerId
Id<'customers'>
Customer ID (defaults to authenticated user if omitted)
paginationOpts
PaginationOptions
required
Pagination options with numItems (1-100) and cursor (timestamp string or null for first page)

Feed Content Types

The feed includes these activity types (filtered by privacy):
  1. Price Updates: From followed stores and on liked products
  2. Product Likes: From followed customers (only if you also like the product)
  3. Product Shares: From followed customers
  4. Direct Shares: Shared directly to you (always visible regardless of privacy)
  5. New Products: From followed stores

Get Feed Debug Info

Debug helper to inspect feed data sources for a customer. Returns counts of followed customers, stores, and recent activity.
customerId
Id<'customers'>
Customer ID (defaults to authenticated user if omitted)

Create Test Product Activity

Helper mutation to create test product activity events for development and testing purposes.
productId
Id<'products'>
required
Product ID for the activity event
activityType
'price_update' | 'product_liked' | 'product_shared' | 'new_product'
required
Type of activity to create
customerId
Id<'customers'>
Optional actor customer ID
oldPrice
number
Previous price (for price_update events)
newPrice
number
New price (for price_update events)

Test Feed

Test function to validate feed functionality. Runs a feed query and returns diagnostic information.
numItems
number
Number of items to request (default: 10)
Social feed includes activity from followed customers and stores with real-time updates. Privacy-restricted content is automatically filtered out.