Methods
# addCustomRequestDecorator(decorator)
Add decorator function to add additional headers in api requests
Parameters:
Name | Type | Description |
---|---|---|
decorator |
function | function which returns modified requests headers |
Example
externalCodeSetup.axiosApi.addCustomRequestDecorator(() => {
return original => {
return args => {
args.headers = {
...args.headers,
"custom-header-key": "custom-header-value"
};
return original(args)
.catch(error => Promise.reject(error))
.then(response => response);
};
}
});
# enableClearCache()
You can use this to enable clearing API cache for each request to ensure the server gives the latest data.
Example
externalCodeSetup.axiosApi.enableClearCache();
# setAchievementsParams(params)
Sets additional params used for fetching achievements that you can display in the achievements sections of your app.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
Example
externalCodeSetup.axiosApi.setAchievementsParams({orderby: "date"});