Interface EnvironmentAPI

interface EnvironmentAPI {
    getAccountId(forceRefresh?: boolean): Promise<string>;
    getRevVersion(forceRefresh?: boolean): Promise<string>;
    getUserLocalIp(
        timeoutMs?: number,
        forceRefresh?: boolean,
    ): Promise<undefined | string>;
}

Hierarchy

  • API
    • EnvironmentAPI

Methods

  • Get's the accountId embedded in Rev's main entry point

    Parameters

    • forceRefresh: boolean = false

    Returns Promise<string>

  • Get's the version of Rev returned by /js/version.js

    Parameters

    • forceRefresh: boolean = false

    Returns Promise<string>

  • Use the Get User Location Service API to get a user's IP address for zoning purposes Returns the IP if ULS enabled and one successfully found, otherwise undefined. undefined response indicates Rev should use the user's public IP for zoning.

    Parameters

    • timeoutMs: number = ...

      how many milliseconds to wait for a response (if user is not) on VPN / intranet with ULS DME then DNS lookup or request can time out, so don't set this too long. Default is 10 seconds

    • forceRefresh: boolean = false

      By default the User Location Services settings is cached (not the user's detected IP). Use this to force reloading the settings from Rev.

    Returns Promise<undefined | string>