Managing social accounts
This recipe explains how to use Snag social integration API to let your users connect their social accounts to their Snag profile.
Overview
This guide explains how to use Snag’s social integration API to let your users connect their social accounts to their Snag profile. After creating a user in Snag (as explained in Managing User Accounts), you can use the social authentication endpoints to connect various social platforms to that user’s profile.
Supported Social Platforms
Snag supports connecting the following social platforms:
- Discord
- Telegram
- Epic Games
- Steam
Connecting a Social Account
Endpoint
Where {authType}
is one of: twitter
, discord
, telegram
, epic
, or steam
.
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
userId | UUID | Yes | The ID of the user received from the user creation endpoint |
websiteId | UUID | No | The ID of the website (if applicable) |
redirect | String | Yes | The URL where the user will be redirected after completing authentication |
responseType | String | No | The type of response to return (redirect or json ). Defaults to redirect |
Example Request
Authentication Flow
- Call the
/api/{authType}/auth
endpoint with the required parameters - The API will return a URL that you should redirect your user to
- The user will authenticate with the social platform and grant permissions
- After successful authentication, the user will be redirected to the URL specified in the
redirect
parameter - The social account is now connected to the user’s Snag profile
Example Implementation
Response Handling
Success Response (200 OK)
The url
property contains the authentication URL that you should redirect your user to.
Custom OAuth Applications
Snag allows you to use your own OAuth applications for Twitter, Discord, Epic Games, and Steam integrations. This enables you to maintain your brand identity throughout the authentication flow and have more control over the user experience.
If you would like to use your own client ID and client secret for any of these platforms, please contact the Snag team for integration support. We’ll guide you through the process of setting up and configuring your custom OAuth applications with our system.
Next Steps
After connecting social accounts, you can use this information to enhance the user experience in your application and leverage it for loyalty program features.
Feedback
We value your feedback! Please share your thoughts below:
Was this page helpful?