IModelApp Class

Global singleton that connects the user interface with the iTwin.js services. There can be only one IModelApp active in a session. All members of IModelApp are static, and it serves as a singleton object for gaining access to session information.

Before any interactive operations may be performed by the @itwin/core-frontend package, IModelApp.startup must be called and awaited. Applications may customize the frontend behavior of iTwin.js by supplying options to IModelApp.startup.


Name Description
constructor(): IModelApp Protected    
getAccessToken(): Promise<string> Static Get the user's access token for this IModelApp, or a blank string if none is available.  
makeHTMLElement<K extends undefined>(type: K, opt?: { className?: string, id?: string, innerHTML?: string, innerText?: string, parent?: HTMLElement }): undefined Static Shortcut for creating an HTMLElement with optional parent, className, id, innerHTML, innerText.  
makeLogoCard(opts: { heading: string | HTMLElement, iconSrc?: string | HTMLImageElement, iconWidth?: number, notice?: string | HTMLElement }): HTMLTableRowElement Static Make a new Logo Card.  
makeModalDiv(options: ModalOptions): ModalReturn Static Shortcut for making a modal dialog on top of the root of the application.  
queryRenderCompatibility(): WebGLRenderCompatibilityInfo Static Obtain WebGL rendering compatibility information for the client system.  
requestNextAnimation(): void Static Request that the event loop execute on the next animation frame.  
shutdown(): Promise<void> Static Must be called before the application exits to release any held resources.  
startup(opts?: IModelAppOptions): Promise<void> Static This method must be called before any other @itwin/core-frontend methods are used.  
translateStatus(status: number): string Static Localize an error status  


Name Type Description
accuDraw Accessor StaticReadOnly AccuDraw The AccuDraw for this session.  
accuSnap Accessor StaticReadOnly AccuSnap The AccuSnap for this session.  
animationInterval Accessor Static undefined | BeDuration Controls how frequently the application polls for changes that may require a new animation frame to be requested.  
applicationId Accessor StaticReadOnly string The Id of this application.  
applicationLogoCard Static undefined | () => HTMLTableRowElement    
applicationVersion Accessor StaticReadOnly string The version of this application.  
authorizationClient Static undefined | AuthorizationClient The AuthorizationClient used to obtain AccessTokens.  
hasRenderSystem Accessor StaticReadOnly boolean Whether the [renderSystem[]] has been successfully initialized.  
hubAccess Accessor StaticReadOnly undefined | FrontendHubAccess Provides access to IModelHub services.  
initialized Accessor StaticReadOnly boolean True after IModelApp.startup has been called, until IModelApp.shutdown is called.  
localization Accessor StaticReadOnly Localization The Localization for this session.  
locateManager Accessor StaticReadOnly ElementLocateManager    
mapLayerFormatRegistry Accessor StaticReadOnly MapLayerFormatRegistry The MapLayerFormatRegistry for this session.  
notifications Accessor StaticReadOnly NotificationManager The NotificationManager for this session.  
onAfterStartup StaticReadonly BeEvent<() => void> Event raised after IModelApp IModelApp.startup completes.  
onBeforeShutdown StaticReadonly BeEvent<() => void> Event raised just before the frontend IModelApp is to be IModelApp.shutdown.  
publicPath Accessor StaticReadOnly string The root URL for the assets 'public' folder.  
quantityFormatter Accessor StaticReadOnly QuantityFormatter The QuantityFormatter for this session.  
realityDataAccess Accessor StaticReadOnly undefined | RealityDataAccess Provides access to the RealityData service implementation for this IModelApp  
renderSystem Accessor StaticReadOnly RenderSystem The RenderSystem for this session.  
securityOptions Accessor StaticReadOnly FrontendSecurityOptions The requested security options for the frontend.  
sessionId Static string A uniqueId for this session  
tentativePoint Accessor StaticReadOnly TentativePoint The TentativePoint for this session]].  
terrainProviderRegistry Accessor StaticReadOnly TerrainProviderRegistry The TerrainProviderRegistry for this session.  
tileAdmin Accessor StaticReadOnly TileAdmin The TileAdmin for this session.  
toolAdmin Accessor StaticReadOnly ToolAdmin The ToolAdmin for this session.  
tools StaticReadonly ToolRegistry The ToolRegistry for this session.  
uiAdmin Accessor StaticReadOnly UiAdmin The UiAdmin for this session.  
userPreferences Accessor StaticReadOnly undefined | UserPreferencesAccess The UserPreferencesAccess for this session.  
viewManager Accessor StaticReadOnly ViewManager The ViewManager for this session.  

Defined in

Last Updated: 04 December, 2023