Sample iModels
The iTwin Studio CLI provides a set of commands to ease the management of sample iModels.
pnpx @bentley/studio-cli samples --helpShare Keys
Section titled “Share Keys”The share-key sub-command provides a set of commands to manage share keys, which are used to fetch sample iModels in iTwin Studio.
pnpx @bentley/studio-cli samples share-key --helpAuthorization
Section titled “Authorization”All share key commands require authentication using the iTwin Platform. The first time you use any command, a browser window will open prompting you for login. You need to have owner access to an iTwin to create a share key for it.
Environment
Section titled “Environment”The following environment variables can be used to override the default authentication and API endpoint configuration:
| Variable | Required | Default | Description |
|---|---|---|---|
STUDIO_CLIENT_ID | No | environment specific iTwin Studio’s client IDs | The iTwin Platform client ID |
STUDIO_SCOPE | No | itwin-platform | The OAuth scope for authorization |
STUDIO_AUTHORITY | No | https://[env-prefix]ims.bentley.com/ | The issuer URL for authentication |
STUDIO_REDIRECT_URI | No | http://127.0.0.1:53386/signin-callback/ | The redirect URI for OAuth flow |
IMJS_URL_PREFIX | No | "" (production) | Alternative environment prefix variable |
List share keys
Section titled “List share keys”Lists all share keys for a given iTwin using the Get iTwin Shares API.
pnpx @bentley/studio-cli samples share-key list --itwin-id <ITWIN_ID> [--env-prefix <ENV_PREFIX>]Create share key
Section titled “Create share key”Creates a new share key for a given iTwin with the iTwinStudioSamples contract using the Create iTwin Share API.
pnpx @bentley/studio-cli samples share-key create --itwin-id <ITWIN_ID> [--env-prefix <ENV_PREFIX>]Revoke share key
Section titled “Revoke share key”Revokes an existing share key using the Revoke iTwin Share API.
pnpx @bentley/studio-cli samples share-key revoke --itwin-id <ITWIN_ID> --share-id <SHARE_ID> [--env-prefix <ENV_PREFIX>]