UserProfile
User profile model matching the Supabase profiles table with role-based access control
Schema
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| id | string (uuid) | ✓ | Profile unique identifier |
| user_id | string (uuid) | ✓ | Reference to auth.users.id |
| email | string (email) | ✓ | User email address |
| display_name | string | | User display name |
| bio | string | | User biography |
| location | string | | User location |
| website | string (uri) | | User website URL |
| avatar_url | string (uri) | | User avatar image URL |
| role | enum | ✓ | User role with hierarchical access levels |
| company | string | | Company name |
| metadata | object | | Flexible key-value metadata |
| subscription | enum | | Subscription tier |
| subscription_started_at | string (date-time) | | Subscription start date |
| subscription_expires_at | string (date-time) | | Subscription expiration date |
| stripe_customer_id | string | | Stripe customer ID |
| stripe_subscription_id | string | | Stripe subscription ID |
| lead_source | string | | Marketing lead source |
| sdk_trial_status | string | | SDK trial status |
| trial_started_at | string (date-time) | | Trial start date |
| trial_expires_at | string (date-time) | | Trial expiration date |
| analytics | object | | Analytics data (stored as JSONB) |
| preferences | object | | User preferences (stored as JSONB) |
| created_at | string (date-time) | ✓ | Profile creation timestamp |
| updated_at | string (date-time) | ✓ | Last update timestamp |
| last_active_at | string (date-time) | | Last activity timestamp |
Example
{
"id": "prof-001",
"user_id": "user-001",
"email": "jon@mycuppa.io",
"display_name": "Jon Oxie",
"bio": "Platform engineer passionate about agentic programming",
"location": "San Francisco, CA",
"website": "https://jonoxie.com",
"avatar_url": "https://cdn.mycuppa.io/avatars/jon.jpg",
"role": "admin",
"company": "MyCuppa",
"subscription": "premium",
"subscription_started_at": "2025-01-01T00:00:00Z",
"subscription_expires_at": "2026-01-01T00:00:00Z",
"preferences": {
"theme": "dark",
"notifications": true
},
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-11-21T10:00:00Z",
"last_active_at": "2025-11-21T10:00:00Z"
}
Enums
role
public | authenticated | betaPartner | internal | admin
subscription
free | member | premium