This guide is for the React SDK only
Overview
When a new user signs up, Dynamic creates a new user record in the database including their general information, and verified credentials. There are four main ways you can programmatically access this new user record as soon as it’s been created:- Handlers: Access the user before authentication completes.
- Webhooks: Listen for a creation event and read the user from the payload.
- Events: Access the user after successful authentication.
- Context (where supported): Read the user from a client context.
handleAuthenticatedUser Handler
The args returned by handleAuthenticatedUser is a UserProfile.
React
User Created Webhook
One of the valid webhook events you can listen to is calleduser.created
(learn more about event types here).All you will need to get started is a server that can receive events, and then you can plug in that URL in the dashboard. Learn more about setting up the webhook step by step here.onAuthSuccess Event
The SDK exposes Events which allow you to hook into lifecycle events. One such event isonAuthSuccess
, which runs when the user has successfully authenticated.React
useDynamicContext
Once placed anywhere inside the component tree that is wrapped by theDynamicContextProvider
, the useDynamicContext
hook will give you access to the user
object.React
User Format
This user record follows a specific format, which you can read all about in the User reference. One important array inside that user object will be calledverified_credentials
. This is where you’ll find information about any and every associated “credential” for the user i.e. email, social, blockchain, passkey.
What next?
Click here to learn more about Verified Credentials