formatUsersData() — supabase Function Reference
Architecture documentation for the formatUsersData() function in Users.utils.tsx from the supabase codebase.
Entity Profile
Dependency Diagram
graph TD 7311069a_4070_4e94_d8d3_5eaf335ec311["formatUsersData()"] 18ff6832_db40_b6e5_0f16_73fa92edbfe6["UsersV2()"] 18ff6832_db40_b6e5_0f16_73fa92edbfe6 -->|calls| 7311069a_4070_4e94_d8d3_5eaf335ec311 d44a1c3b_079d_7fa6_71ab_78eb4daff73a["getAvatarUrl()"] 7311069a_4070_4e94_d8d3_5eaf335ec311 -->|calls| d44a1c3b_079d_7fa6_71ab_78eb4daff73a 3c05a680_a8e3_7a53_e059_ae8513da59ad["getDisplayName()"] 7311069a_4070_4e94_d8d3_5eaf335ec311 -->|calls| 3c05a680_a8e3_7a53_e059_ae8513da59ad style 7311069a_4070_4e94_d8d3_5eaf335ec311 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/studio/components/interfaces/Auth/Users/Users.utils.tsx lines 24–65
export const formatUsersData = (users: User[]) => {
return users.map((user) => {
const provider: string = (user.raw_app_meta_data?.provider as string) ?? ''
const providers: string[] = user.providers.map((x: string) => {
if (x.startsWith('sso')) return 'SAML'
return x
})
return {
id: user.id,
email: user.email,
phone: user.phone,
created_at: user.created_at,
last_sign_in_at: user.last_sign_in_at,
providers: user.is_anonymous ? '-' : providers,
provider_icons: providers
.map((p) => {
return p === 'email'
? `${BASE_PATH}/img/icons/email-icon2.svg`
: p === 'SAML'
? `${BASE_PATH}/img/icons/saml-icon.svg`
: providerIconMap[p]
? `${BASE_PATH}/img/icons/${providerIconMap[p]}.svg`
: undefined
})
.filter(Boolean),
// I think it's alright to just check via the main provider since email and phone should be mutually exclusive
provider_type: user.is_anonymous
? 'Anonymous'
: provider === 'email'
? '-'
: socialProviders.includes(provider)
? 'Social'
: phoneProviders.includes(provider)
? 'Phone'
: '-',
// [Joshen] Note that the images might not load due to CSP issues
img: getAvatarUrl(user),
name: getDisplayName(user),
}
})
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does formatUsersData() do?
formatUsersData() is a function in the supabase codebase.
What does formatUsersData() call?
formatUsersData() calls 2 function(s): getAvatarUrl, getDisplayName.
What calls formatUsersData()?
formatUsersData() is called by 1 function(s): UsersV2.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free