Sync WorkOS AuthKit authentication events and user data directly into your Convex database with pre-built webhooks and queries.
npm install @convex-dev/workos-authkitThis component is the official way to integrate WorkOS AuthKit authentication with your Convex project.
Features:
Sync user data from WorkOS to your Convex database reliably and durably.
Respond to events with Convex functions.
See example for a demo of how to incorporate this component into your application.
Open a GitHub issue with any feedback or bugs you find.
Prerequisites#
Follow the Convex WorkOS AuthKit guide to set up a working project with WorkOS AuthKit.
Then follow the steps below to set up user data syncing and event handling.
The @convex-dev/workos-authkit component automatically syncs user data from WorkOS AuthKit to your Convex database through webhook handlers. It creates and updates user records when authentication events occur, keeping your local user data in sync without manual API calls.
This component provides pre-built webhook endpoints that handle WorkOS AuthKit events like user creation, updates, and deletions. The webhooks automatically trigger Convex actions to update your database, eliminating the need to write custom webhook parsing logic.
After syncing with @convex-dev/workos-authkit, you can query WorkOS user profiles and organization data directly from Convex without external API calls. The component stores user attributes, roles, and organization memberships in your Convex database for fast local access.
The @convex-dev/workos-authkit component uses WorkOS webhooks to automatically sync user data to your Convex database. When users sign up, update profiles, or change organizations in WorkOS, the component receives webhook events and updates the corresponding records in Convex through built-in actions.
The component handles standard WorkOS AuthKit events including user creation, profile updates, organization membership changes, and user deletions. Each event type triggers corresponding Convex actions that maintain data consistency between WorkOS and your Convex database.
Yes, the @convex-dev/workos-authkit component allows you to customize the database schema and data transformation logic. You can modify which user attributes are stored, add custom fields, and define how organization data maps to your Convex tables while maintaining the automatic synchronization.
The @convex-dev/workos-authkit component includes recommended schema definitions for storing WorkOS user and organization data in Convex. You can use the provided schemas or adapt them to fit your existing database structure while ensuring compatibility with the synchronization actions.