Skip to content

Minimal iTwin.js command-line app that pulls from iModelHub

License

Notifications You must be signed in to change notification settings

mgooding/simple-itwinjs-cli-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-itwinjs-cli-app

This is a minimal example of a command-line iTwin.js application that downloads an iModel from iModelHub and prints the result of an ECSQL query.

Prerequisites

  • Node: an installation of the latest security patch of Node 14.

Setup

Edit IMODELHUB_REQUEST_PROPS in Main.ts to replace iTwinId and iModelId with the appropriate values for your iModel.

You will also need to provide a clientId, scope and redirectUri for your application. To register an application, go to https://developer.bentley.com/register/.

  • Add "Digital Twin Management" as API Associations to get the "imodels:read" scope
  • Select "Desktop/Mobile" as the Application Type
  • Enter "http://localhost:3000/signin-callback" for Redirect URI
  • No logout URI is required

Once your application is created, go to its details page and copy/paste the scope, clientId and redirectUri fields into AUTH_CLIENT_CONFIG_PROPS in Main.ts.

Open your favorite shell to the root of the cloned repository and:

npm install
npm run build
npm start

About

Minimal iTwin.js command-line app that pulls from iModelHub

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published