overwolf.profile

Use the overwolf.profile API to get Overwolf information for the current user of the app (e.g user name, user log-in event, etc.)

Methods

getCurrentUser(callback)

Version added: 0.78

Calls the given callback with the currently logged-in Overwolf user.

 

Note: If the user is not logged-in, the "status" will be "error", but you’ll still get the rest of the available data (userId, machineId, etc.)

Example:

{  
   "status":"error",
   "username":null,
   "userId":"OW_34153336-192b-44f6-aa0f-4a9b744c689d",
   "machineId":"653000ad-001c-43e9-a5c9-e23db5ad370a",
   "partnerId":0,
   "channel":"website",
   "reason":"Not signed in"
}
  • Parameter: callback <function>

    A function called with the current user, or an error.

Callback argument:
{  
   "status":"success",
   "username":"itaygl",
   "userId":"OW_34153336-192b-44f6-aa0f-4a9b744c689d",
   "machineId":"653000ad-001c-43e9-a5c9-e23db5ad370a",
   "partnerId":0,
   "channel":"website"
}

openLoginDialog()

Version added: 0.80.0

Opens the login dialog.

Events How to use events

onLoginStateChanged

Version added: 0.78

Fired when a user logged in or logged out, with the following structure:

Event value:
{
    status: "success",
    connectionState: "Online", // can be "Online", "Offline", "Connecting", etc.
    username: "..." // when the status is other than "Offline", will be the currently connected username.
}