Skip to main content

Overview

When a new user signs up, Dynamic creates a new user record in the database including their general information, and verified credentials. You can access that user via a webhook, or using SDK specific methods.

User Created Webhook

One of the valid webhook events you can listen to is called user.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.

SDK Specific Methods

authSuccess Event

Listen to the authentication success event to access the user right after login:
React Native
import { dynamicClient } from '<path to client file>';

dynamicClient.auth.on('authSuccess', (user) => {
  console.log('user', user);
});

Accessing the current user

You can read the authenticated user directly from the client:
React Native
import { dynamicClient } from '<path to client file>';

const user = dynamicClient.auth.authenticatedUser;
console.log('user', user);
Or, if you’re using our React hooks for client reactivity:
React Native
import { useDynamic } from '<path to client file>';
import { View } from 'react-native';

function MyComponent() {
  const { auth } = useDynamic();
  console.log('user', auth.authenticatedUser);
  return <View />;
}

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 called verified_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