async function identifyUser(user) {
    // Return early if window.posthog doesn't exist
    if (!isPosthogLoaded()) {
        return;
    }
    // User the user exists and has an email address, identify them in PostHog
    if (user && user.get('email')) {
        const email = user.get('email');
        const hashedEmail = await hashEmail(email);
        const distinctId = window.posthog.get_distinct_id();
        // Only continue if hashing was successful, and the user hasn't already been identified
        if (hashedEmail && hashedEmail !== distinctId) {
            const props = {};
            // Add the user's id
            if (user.get('id')) {
                props.id = user.get('id');
            }
            // Add the user's role
            if (user.get('role').name) {
                props.role = user.get('role').name.toLowerCase();
            }
            // Add the user's created_at date
            if (user.get('createdAtUTC')) {
                props.created_at = user.get('createdAtUTC').toISOString();
            }
            window.posthog.identify(hashedEmail, props);
        }
    }
}
Calls posthog.identify() with a hashed email address as the distinct_id

@param {Object} user A user to identify in PostHog
@returns {void}