Login Types
UnionWhich identifier the player is authenticating with. It appears as the loginType field on login and tells the backend how to read the username you send — as an account name, an email address or a phone number. The SDK maps each name to the numeric code the swarm expects, so pass the string and let the SDK translate it.
Possible values
Every literal this type accepts.
| Value | Description |
|---|---|
'userName' | The account name the player chose at registration. |
'email' | The email address registered on the account. |
'phone' | The phone number registered on the account. |
Notes
Leaving it out lets the backend decideThe field is optional. When you omit it the backend resolves the identifier itself
The wire format is a numberThe swarm transports login types as numeric codes, and the SDK converts between the name and the code for you in both directions — pass the string and you never have to touch a number. You will still see the codes in raw swarm payloads and in logs, so here is the full list: userName 1, email 2 and phone 3. Unlike the other mapped types these start at 1 rather than 0, so there is no zero value to mean "unset" — an omitted login type is simply absent from the request.
It is userName, with a capital NThe SDK validates the value against its own list before sending the request, and the all-lowercase username is not on it — a login that passes username is rejected on the client and never reaches the swarm. Spell it userName, while the email and phone values stay lowercase.
Was this page helpful?