Methods
(static) authenticate(params) → {Promise.<AuthResponse>}
Authenticate with GetSocial.
Parameters:
Name |
Type |
Description |
params |
Object
|
Authentication parameters.
Properties
Name |
Type |
Description |
identity_type |
string
|
Custom identity type, e.g email or myapp . |
value |
string
|
Value of the identity, e.g example@example.com . Must be an empty string if identity_type is facebook . |
token |
string
|
A unique token for this user. You will need to provide the same token to be able to reauthenticate as this user. We recommend using a hash of the identity value and a secret as the token. If identity_type is facebook , use a valid Facebook access token instead. |
new_user |
boolean
|
Whether this user is new to your app or not. |
|
- Source:
Returns:
A Promise for the authenticated user and referral information.
-
Type
-
Promise.<AuthResponse>
(static) logout()
Logs out the current user.
- Source:
Type Definitions
AuthResponse
Type:
Properties:
Name |
Type |
Description |
user |
User
|
Authenticated user |
referral |
Object
|
Referral information, if any
Properties
Name |
Type |
Description |
data |
Object
|
Referral data, see reference. |
original_data |
Object
|
Contains original values of keys in data if they were overriden. |
referrer |
User
|
The user who referred the current user, if any. |
|
- Source:
User
Type:
Properties:
Name |
Type |
Description |
user.id |
string
|
User ID |
user.display_name |
string
|
Username |
user.avatar_url |
string
|
URL to user's picture |
user.auth_identities |
Object
|
Custom identity key/value pairs, e.g "email":"hello@example.com" |
user.public_properties |
Object.<string, string>
|
User's Public Properties key/value pairs, e.g "level":"1" |
user.private_properties |
Object.<string, string>
|
User's Private Properties key/value pairs, e.g "paying_user":"true" |
- Source: