How to set up your development project

How to set up your development project

Getting started developing against a Twinfinity portal is straightforward. This article walks you through setting up your project step by step, and what you need to get everything up and running.

Prerequisites

There are a few things to sort out before you can start developing against a Twinfinity portal. For your convenience, we've listed them here:

  • certificate.key and certificate.pem files

  • A client ID, provided by Twinfinity. Reach out to your local Twinfinity contact to acquire one.

  • An IDP URL, typically bim.[your portal url]/idp

Steps to set up your project

Setting up your project is easy with the Twinfinity templates. This npm package helps you set up everything you need, from authentication to loading your first model, giving you a solid starting point for your Twinfinity digital twin project. Here are the steps to get a development project running against a Twinfinity portal:

  1. Open your favourite IDE.

  2. Install the Twinfinity templates:

    npm install -g @twinfinity/templates
  3. Create a directory for your project.

  4. In your IDE terminal, run:

    twinfinity-templates typescript <project directory>
  5. Add your certificate.key and certificate.pem files to your project directory.

  6. In your IDE, open a terminal and run:

    cd <project directory> npm install npm run serve

Your project is now running and can be viewed in a browser at localhost:9000.