Skip to main content

Introduction

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. If you’d like to see the Dynamic Widget/Embedded Widget in action, head over to the live demo.

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

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

Allow user to update their profile information

How: useUserUpdateRequest hook Hook/Component: useUserUpdateRequest Notes: We include the validation for email updates here

Socials

Show users linked social accounts, allow linking/unlinking

How: useSocialAccounts hook from sdk-react-core Hook/Component: useSocialAccounts Notes: None