Skip to content
bg2 engine

Getting Started with TypeScript

This section provides a minimal introduction to start using the bg2 engine TypeScript API.

The TypeScript API is distributed as an npm package.

Terminal window
npm install bg2e-js

Once installed, you can import the engine modules directly in your project.

Also, you can get the source code for the TypeScript API from the official repository:

Terminal window
git clone https://github.com/ferserc1/bg2e-js

Although the API can be used from plain JavaScript, TypeScript is strongly recommended.

  • The API provides full type definitions
  • Improves maintainability and developer experience
  • Ensures consistency with the engine design

JavaScript support is currently available for compatibility reasons, but it is considered transitional. Future versions of the engine will deprecate JavaScript support in favor of a TypeScript-only API.


Detailed setup, examples, and usage patterns are covered in the TypeScript tutorials.

Refer to the tutorials section for:

  • Project setup
  • Creating your first application
  • Rendering basics
  • Input handling and interaction

Creation tools (asset generation, scene authoring, etc.) are currently available only as native applications built from the C++ API source code.

To use these tools, refer to the C++ API Getting Started guide, which explains how to download, build, and run them.


Continue with the TypeScript tutorials to build your first application and explore the engine features in detail.