# Send your user's hashed email
# You have your user's email address
If you wish, and if you have your user's email address (form, user account, etc.), you can send it to us, and benefit from a cross-device First-id.
Thanks to our SDK, you can call First-id to attach the user's SHA256 hashed email to his First-id cookie:
// load our SDK
<script src="SDK_LOADER_URL"></script>
<script>
// init the First-id SDK
// ...
// set the hashed email value in SHA256 of the user
FIRSTID.setEmailHashed('<EMAIL_HASHED_VALUE>');
// ...
</script>
# A previous First-id is attached to his hashed email address
In some cases, the user already has a First-id cookie, but another First-id token is already attached to their hashed email address.
To improve First-id's cross-device / cross-domain performance, we need to resynchronize the First-id cookie present on the Gate domain (gate.first-id.fr) with the one previously linked to the user's email address.
To do this, after calling the First-id SDK to set the hashed email, the SDK will check whether the current user's hashed email is already known. If so, we'll compare the current First-id with the First-id previously stored for this hashed email.
If they are not identical, the SDK will create a cookie with the name “firstid_refresh” and the value “true”.
You can customize the name of this cookie when you initialize the SDK, as shown below:
// load our SDK
<script src="SDK_LOADER_URL"></script>
<script>
// init the First-id SDK
window.firstId = window.firstId || {
// ...
refreshCookieName: '<REFRESH_COOKIE_NAME>', // the name of the cookie that SDK create to tell you to make a redirect to our gate to resync the First-id value
};
</script>
Then you'll need to check whether this cookie “firstid_refresh”exists, and whether its value is “true”. If so, you'll need to redirect the user to the Gate to resynchronize the First-id cookie with the First-id previously linked to his email address.
You've just set up a more efficient cross-device First-id cookie 🎉.