zorZ
Convex Community2y ago
38 replies
zor

Clerk authenticates, Convex do user management and features. Convex stores user data

Objective
Minimal Clerk Side: Use Clerk primarily for user authentication.
Convex for User Data Management: Store and manage all user-related data within Convex.
Key Steps
Set Up Convex Schema: Define the user schema in Convex to store necessary user data fields.
Use Convex for Data Operations: Implement queries and mutations in Convex to manage user data, ensuring that all relevant user information is stored in Convex so I can process.

I won't create custom flows with Clerk but I will build custom flows with my own database(fetch from my own DB, since storing the same data with Clerk which means similar thing) and backend but Clerk securely handles authentication
E.g. I won't use useUser(); from Clerk but useMyDatabaseUser();

In the philosophy of store minimal in Clerk. Isn't it better to manage such features¹ in Convex rather than Clerk?
¹:
    last_sign_in_at: number | null;
    last_active_at: number | null;
    password_last_updated_at: number | null;
    two_factor_enabled: boolean;
    external_accounts: ExternalAccountJSON[];

E.g. features² probably something we wouldn't have in Convex and Clerk has some characteristics on them
²:
    lockout_expires_in_seconds: number | null;
    verification_attempts_remaining: number | null;
    external_accounts: ExternalAccountJSON[];
    banned: boolean;
    locked: boolean;

Feel free to share some insights!
My approach is copying the UserJSON to my database. Manage the user data from my databases User object and sync when it changes
So I will never use useUser() and as I said, useMyDatabaseUser()
Was this page helpful?