Dynamic 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 at https://demo.dynamic.xyz/.Hooks Only (Headless)
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 alreadyProfile 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.Allow user to update their profile information
How: useUserUpdateRequest hook Hook/Component: useUserUpdateRequest Notes: We include the validation for email updates here. This hook also supports updating custom metadata fields for storing additional user data.Socials
Show users linked social accounts, allow linking/unlinking
How: useSocialAccounts hook from sdk-react-core Hook/Component: useSocialAccounts Notes: NoneWorking 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