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(): Promise<void> Static This method must be called when an iModel.js services is shut down.  
startup(configuration: IModelHostConfiguration = new IModelHostConfiguration()): Promise<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 AuthorizationClient | undefined Implementation of AuthorizationClient 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    
cacheDir Accessor StaticReadOnly string Root of the directory holding all the files that iModel.js caches  
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  
snapshotFileNameResolver Static undefined | FileNameResolver The optional FileNameResolver that resolves keys and partial file names for snapshot iModels.  
tileCacheService Static CloudStorageService   Beta

Defined in

Last Updated: 03 May, 2020