overwolf.extensions.sharedData API
A set of APIs to allow independent extensions to communicate with each other.
Methods Reference
Events Reference
Types Reference
- overwolf.extensions.sharedData.SharedDataParams Object
- GetResult Object
- onChangedEvent Object
set(string appId, object value, callback)
Version added: 0.137
Used by the owner app to set data for the consumer app, by appId.
This function is one part of the service providing app to communicate with the consumer apps. for instance, Game Summary hosts GPO app in a tab. Game Summary is the owner, GPO is the cosumer.
Parameter | Type | Description |
---|---|---|
appId | string | The requested app id |
value | object | |
callback | (Result: GetResult) => void | a status indicating success or failure |
get(SharedDataParams param, callback)
Version added: 0.137
Used by the consumer app to get data set by the owner app.
This function is one part of the service providing app to communicate with the consumer apps. for instance, Game Summary hosts GPO app in a tab. Game Summary is the owner, GPO is the cosumer.
Parameter | Type | Description |
---|---|---|
param | SharedDataParams object | |
callback | (Result: GetResult) => void | a status indicating success or failure |
Usage examples
overwolf.extensions.sharedData.get(
{origin:"nafihghfcpikebhfhdhljejkcifgbdahdhngepfb"},
data => {
// Process game enable state
// See result callback format below
}
);
overwolf.extensions.sharedData.get({},console.log) //retrun all data set to my self
overwolf.extensions.sharedData.get({origin:"*"},console.log) //return all data was set to my self
overwolf.extensions.sharedData.get({target:"fiekjlgoffmlmgfmggnoeoljkmfkcapcdmcgcfgm"},console.info) //retrun data i set to "fiekjlgoffmlmgfmggnoeoljkmfkcapcdmcgcfgm" (extension id)
onChanged
Version added: 0.137
Fired when the hosting app state changes, with the following structure: onChangedEvent Object
SharedDataParams Object
Version added: 0.137
Container that represent a shared data parameters.
Parameter | Type | Description |
---|---|---|
origin | string | |
target | string |
GetResult Object
Parameter | Type | Description |
---|---|---|
success | boolean | Inherited from the "Result" Object |
error | string | Inherited from the "Result" Object |
data | <Dictionary> string | Dictionary<T>: An object that maps strings to values of type "T" |
onChangedEvent Object
Parameter | Type | Description |
---|---|---|
origin | string | |
target | string | |
data | string |
Event Data Example: Success
{
"origin": string (uid),
"target": string (uid),
"data": string
}