Using our UI
The Dynamic Widget UI component and Dynamic Embedded Widget UI component both contain a user profile section where the user can see their profile information and update it easily. You can check it out athttps://demo.dynamic.xyz/.
Using your UI
This guide will help you to create a completely headless user profile including everything you see in the regular Dynamic Widget UI component/Dynamic Embedded Widget UI component described above.Prerequisites
Like with all this series of headless guides, “headless” is defined a way to use the Dynamic SDK without the need for Dynamic UI components (i.e. DynamicWidget, DynamicUserProfile). You still need to add the SDK and set up the Dynamic Context Provider (complete the quickstart if you haven’t done so already, or refer to an example app)Setup
Show the user’s profile based on whether they are logged in or not
How: Check if the user is logged in or not Hook/Component: useIsLoggedIn Notes: We start here assuming you have signup/login implemented already- React
React provides the
useIsLoggedIn hook to check authentication status and conditionally render components.React
Profile Info
Show user profile information
How: Fetch info from user object on useDynamicContext Hook/Component: useDynamicContext Notes: The format of the user can be found here: userProfile. For working with custom metadata fields and storing additional user data, see User Metadata.- React
React provides the
useDynamicContext hook to access user information and display profile details.React
Allow user to update their profile information
- React
- React Native
How:
useUserUpdateRequest and useOtpVerificationRequestHook/Component: useUserUpdateRequestNotes: Use the appropriate verification flag: isEmailVerificationRequired for email changes; isSmsVerificationRequired for phone changes. Metadata updates and general text fields typically do not require OTP.Updating Email
React
Updating Phone
React
Updating Meta
React
Updating General
React
Socials
Show users linked social accounts, allow linking/unlinking
How: useSocialAccounts hook from sdk-react-core Hook/Component: useSocialAccounts Notes: None- React
React provides the
useSocialAccounts hook to manage social account linking and unlinking with a comprehensive UI component.React
Working with User Metadata
User metadata provides a powerful way to store additional information beyond the standard profile fields. This is perfect for storing user preferences, application state, custom attributes, and integration data.What is Metadata?
Metadata is a flexible key-value storage system that allows you to:- Store user preferences (theme, language, notification settings)
- Track application state (onboarding progress, feature flags)
- Store business-specific data (subscription tiers, referral codes)
- Maintain integration data (external service IDs, webhook configs)
Metadata Examples
Best Practices
- Size limit: Metadata is limited to 2KB total
- Key naming: Use descriptive, lowercase keys with underscores
- Value types: Supports strings, numbers, booleans, and nested objects
- Validation: Always validate on your backend before storing
For how to add metadata to the user and update it, see Custom Information Capture.
- Updated the “Allow user to update their profile information” section with distinct “Updating Email”, “Updating Phone”, “Updating Meta”, and “Updating General” subsections for both React and React Native, and used
isSmsVerificationRequiredfor phone updates.