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): Promise<AccessToken> Static Get the active authorization/access token for use with various services  
shutdown(): Promise<void> Static This method must be called when an iModel.js services is shut down.  
startup(configuration: IModelHostConfiguration = ...): Promise<void> Static This method must be called before any iModel.js services are used.  

Properties

Name Type Description
appAssetsDir Accessor StaticReadOnly undefined | string The directory where application assets may be found  
applicationId Accessor Static string The Id of this application - needs to be set only if it is an agent application.  
applicationVersion Accessor Static string The version of this application - needs to be set if is an agent application.  
authorizationClient Static undefined | AuthorizationClient    
backendVersion Static string    
cacheDir Accessor StaticReadOnly string Root of the directory holding all the files that iModel.js caches  
configuration Static undefined | IModelHostConfiguration    
iModelClient Accessor StaticReadOnly IModelClient    
isUsingIModelBankClient Accessor StaticReadOnly boolean    
isValid Accessor StaticReadOnly boolean Returns true if IModelHost is started.  
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 StaticReadonly BeEvent<() => void> Event raised just after the backend IModelHost was started  
onBeforeShutdown StaticReadonly BeEvent<() => void> Event raised just before the backend IModelHost is to be shut down  
sessionId Accessor Static string A uniqueId for this session  
snapshotFileNameResolver Static undefined | FileNameResolver The optional FileNameResolver that resolves keys and partial file names for snapshot iModels.  
tileCacheService Static CloudStorageService    

Defined in

Last Updated: 29 November, 2022