import axios from 'axios'
GrantRequestFunctionType,
const UX4IOT_URL = 'https://ux4iot-xyz.westeurope.azurecontainer.io'
const CUSTOM_BACKEND = 'https://your-iot-app.com/api/ux4iot-grant-requests'
const customGrantRequestFunction: GrantRequestFunctionType = async grantRequest => {
Authorization: "Bearer " + getCurrentAccessToken()
await axios.put(CUSTOM_BACKEND, grantRequest, config);
if (axios.isAxiosError(error)) {
if (error.response.status === 401) {
return GRANT_RESPONSES.UNAUTHORIZED;
} else if (error.response.status === 403) {
return GRANT_RESPONSES.FORBIDDEN;
return GRANT_RESPONSES.ERROR;
return GRANT_RESPONSES.GRANTED;
const prod: InitializeProdOptions = {
ux4iotURL: UX4IOT_WEBSOCKET_URL
grantRequestFunction: customGrantRequestFunction
return <Ux4iotContextProvider options={prodOptions}>...</Ux4iotContextProvider>