Collecting emails during social authentication

How It Works

Most social networks do not share their users’ email addresses. Xsolla Login allows you to collect them when users authenticate via social networks and use the collected data to:

  • Export users’ emails to your Mailchimp account and send newsletters
  • Allow users to reset the password and re-authenticate via both social network accounts and the email/password pair

Note: If you have integrated Xsolla Launcher, emails are collected automatically without any additional settings.

Who Can Use It

Partners who have already integrated Login and whose users authenticate via social networks.

How to Get It

Depending on the Login integration flow, there are two ways to enable collecting emails:

Collecting emails via a Widget

If you integrated Login via a widget, in the initialization step add the fields parameter with the email value to the widget initialization code:

<script type="text/javascript">
XL.init({
  projectId: '{Login ID}',
  callbackUrl: '{callbackUrl}',
  locale: 'en_US',
  fields: 'email'
});
</script>

Collecting emails via API

If you integrated Login via API, add the fields parameter with the email value when calling the authentication via a social network method:

GET https://login.xsolla.com/api/social/{providerName}/login_redirect?projectId={projectId}&fields=email&login_url={login_url}