ArcGISContext

Class

Abstraction that holds a UserSession, along with getters to streamline access to various platform urls, and common constructs like IRequestOptions, IUserRequestOptions etc.

Instances are intended to be immutable, but this is not directly enforced.

In most circumstances, this class should be created by the ArcGISContextManager class.

Implements

Constructors

Constructor Parameters

Parameter Type Default Notes
opts Required IArcGISContextOptions

Properties

Property Type Notes
id number

Unique id from the ArcGISContextManager that created this instance. Primarily useful for debugging possible race-conditions that can result in multiple ArcGISContextManager instances being created.

Accessors

Accessor Type Notes
communityOrgHostname string

Returns the Hub Community Org Hostname, if defined

communityOrgId string

Return the Hub Community Org Id, if defined

communityOrgUrl string

Returns the Hub Community Org url

currentUser IUser

Returns the current user as IUser

discussionsServiceUrl string

Returns the discussions API URL

domainServiceUrl string

Returns Hub Domain Service URL

eventsConfig any

Returns the Events configuration object from portal/self

helperServices any

Returns the hash of helper services from portal self

hubEnabled boolean

Returns boolean indicating if the current user belongs to an organization that has licensed ArcGIS Hub

hubRequestOptions IHubRequestOptions

Return a IHubRequestOptions object

hubSearchServiceUrl string

Returns the Hub Search API URL

hubUrl string

Returns the Hub url, based on the portalUrl

isAuthenticated boolean

Return boolean indicating if authenticatio is present

isPortal boolean

Returns boolean indicating if the backing system is ArcGIS Enterprise (formerly ArcGIS Portal) or not

portal IPortal

Returns the portal object as IPortal

portalUrl string

Return the portal url i.e. https://www.arcgis.com

properties Record<stringany>

Return the properties hash that was passed in. Useful for app-specific context such as the active Site for ArcGIS Hub

requestOptions IRequestOptions

Return IRequestOptions, which is used by REST-JS functions which may use authentication information if provided.

session UserSession

Return the UserSession if authenticated

sharingApiUrl string

Returns the url to the sharing api composed from portalUrl i.e. https://myorg.maps.arcgis.com/sharing/rest

userRequestOptions IUserRequestOptions

Return IUserRequestOptions, which is used for REST-JS functions which require authentication information.


Class defined in common/src/ArcGISContext.ts:208