IQRF Gateway Webapp JavaScript client - v0.3.0-beta.13
    Preparing search index...

    Class Client

    IQRF Gateway Webapp API client class

    Client is a wrapper around API methods of IQRF Gateway Webapp providing shared configuration for Axios instance.

    const client = new Client();
    
    const config: AxiosRequestConfig = {
    baseURL: 'https://iqrf-gw.exaple.org/api/',
    };
    const client = new Client({ config });
    const config: AxiosRequestConfig = {
    baseURL: 'https://iqrf-gw.exaple.org/api/',
    }
    const axiosInstance = axios.create(config);
    const client = new Client({ axiosInstance
    Index

    Constructors

    Methods

    • Clear all request interceptors

      Returns void

    • Clear all response interceptors

      Returns void

    • Eject a request interceptor

      Parameters

      • interceptorId: number

        Interceptor ID

      Returns void

    • Eject a response interceptor

      Parameters

      • interceptorId: number

        Interceptor ID

      Returns void

    • Sets API key or JWT token

      Parameters

      • token: null | string

        API key or JWT token

      Returns void

      Implement API key and JWT validation

    • Add a request interceptor

      Parameters

      • OptionalonFulfilled:
            | null
            | (
                (
                    value: InternalAxiosRequestConfig,
                ) =>
                    | InternalAxiosRequestConfig<any>
                    | Promise<InternalAxiosRequestConfig<any>>
            )

        Fulfilled callback

      • OptionalonRejected: null | ((error: any) => any)

        Rejected callback

      • Optionaloptions: AxiosInterceptorOptions

        Interceptor options

      Returns number

      Interceptor ID

    • Add a response interceptor

      Parameters

      • OptionalonFulfilled:
            | null
            | (
                (
                    value: AxiosResponse,
                ) => AxiosResponse<any, any> | Promise<AxiosResponse<any, any>>
            )

        Fulfilled callback

      • OptionalonRejected: null | ((error: any) => any)

        Rejected callback

      Returns number

      Interceptor ID