Appearance
Social Login
The SDK supports social login (Google, Facebook, Apple).
The flow is as follows:
- Your frontend uses the official provider SDK (e.g., Google Identity Services) to authenticate the user.
- The provider returns a short-lived
id_token. - You pass this token to the Platform SDK to exchange it for a Casino Session.
Example (Google Login)
javascript
// 1. Get Google Token (using Google's frontend library)
const googleResponse = await google.accounts.id.getToken();
const idToken = googleResponse.credential;
// 2. Exchange it for a Casino Session via Platform SDK
await sdk.auth.loginWithSocial('GOOGLE', idToken);
// User is now logged into your platform!The backend will verify the token with Google, find or create the user in your database, and return standard JWTs that the SDK will automatically manage.