ArcGISContextManager
The manager exposes context (IArcGISContext
), which combines a UserSession
with
the portal/self
and user/self
responses to provide a central lookup for platform
information, api urls, and other useful properties for developers such as IRequestOptions
IUserRequestOptions, IHubRequestOptions etc.
The context is exposed on gthe .context
property, and as the authentication changes
the .context
is re-created. This is done to allow web frameworks to watch for
changes on that single property, instead of having to leverage observers or events
for change detection.
Please see the ArcGISContext Guide for additional information.
Properties
Property | Type | Notes |
---|---|---|
number |
Random identifier useful for debugging issues where race-conditions can result in multiple contexts getting created |
Accessors
Accessor | Type | Notes |
---|---|---|
IArcGISContext |
Return a reference to the current state.
When |
Methods
Method | Returns | Notes |
---|---|---|
|
Promise<ArcGISContextManager> |
Used to create a new instance of the ArcGISContext class.
|
|
void |
Clear the Authentication (UserSession). This should be called when a user signs out of an application, but the application continues running |
|
Promise<void> |
Set the Authentication (UserSession) for the context. This should be called when a user signs into a running application. |
|
void |
Set the properties hash and re-create the context |
create
StaticParameters
Parameter | Type | Default | Notes |
---|---|---|---|
opts Optional | IArcGISContextManagerOptions | {} |
Returns
const ctxMgr = await ArcGISContextManager.create();
clearAuthentication
Clear the Authentication (UserSession). This should be called when a user signs out of an application, but the application continues running
Returns
setAuthentication
Set the Authentication (UserSession) for the context. This should be called when a user signs into a running application.
Parameters
Returns
Class defined in common/src/ArcGISContextManager.ts:85
Used to create a new instance of the ArcGISContext class.