IModelHost Class

IModelHost initializes imodeljs-backend and captures its configuration. A backend must call IModelHost.startup before using any backend classes. See the learning article

Methods

Name Description
getAccessToken(requestContext: ClientRequestContext = new BackendRequestContext()): Promise<AccessToken> Static Get the active authorization/access token for use with various services  
shutdown(): void Static This method must be called when an iModel.js services is shut down.  
startup(configuration: IModelHostConfiguration = new IModelHostConfiguration()): void Static This method must be called before any iModel.js services are used.  

Properties

Name Type Description
appAssetsDir Accessor StaticReadOnly string | undefined The directory where application assets may be found  
applicationId Static string The Id of this backend application - needs to be set only if it is an agent application.  
applicationVersion Static string The version of this backend application - needs to be set if is an agent application.  
authorizationClient Accessor Static IAuthorizationClient | undefined Implementation of IAuthorizationClient to supply the authorization information for this session - only required for agent applications, or backends that want to override access tokens passed from the frontend  
backendVersion Static string    
configuration Static undefined | IModelHostConfiguration    
logTileLoadTimeThreshold Accessor StaticReadOnly number The backend will log when a tile took longer to load than this threshold in seconds.  
logTileSizeThreshold Accessor StaticReadOnly number The backend will log when a tile is loaded with a size in bytes above this threshold.  
onAfterStartup Static BeEvent<() => void> Event raised just after the backend IModelHost was started  
onBeforeShutdown Static BeEvent<() => void> Event raised just before the backend IModelHost is to be shut down  
sessionId Static GuidString A uniqueId for this backend session  
tileCacheService Static CloudStorageService   Beta

Defined in

Last Updated: 08 January, 2020