I think here we can create a global or local variable with the context params.
var contextProperties = {platform: platform, devices: devices, deviceType: deviceType, shareGroup: 0, hint: null}
?