/ guide · npm quick start

Install the Rasterex Viewer SDK with npm.

Add @rasterex/viewer to a JavaScript or TypeScript application, then use the documented Viewer lifecycle to embed Rasterex Canvas.

/ installation

Install the documented package.

Step 01

Install the Viewer SDK

terminal · bash
$ npm install @rasterex/viewer

The package belongs in the frontend application that owns the page or component where Canvas will appear. Installation prepares the integration; it does not replace the Canvas environment or the host application’s document access rules.

Verify the Viewer lifecycle next.

Step 02

Create, mount and wait for Canvas

application code · javascript
01import { createViewer } from "@rasterex/viewer";02 03const viewer = createViewer({ container: "#rx-viewer" });04 05async function start() {06  await viewer.mount();07  await viewer.ready();08}09 10start().catch(console.error);
  • Provide a visible container with an explicit height.
  • Wait for mount() and ready() before opening documents or sending viewer commands.
  • Use the JavaScript and TypeScript guide for document opening, types and component cleanup.
/ common questions

NPM Viewer SDK answers.

What is the Rasterex npm package?

The current package is @rasterex/viewer. It provides the Viewer SDK used by a JavaScript or TypeScript application to create and control an embedded Rasterex Canvas viewer.

Do I need React to use @rasterex/viewer?

No. The Viewer SDK is a JavaScript and TypeScript integration path. Current documentation includes plain JavaScript, TypeScript, React, Vue and Angular examples.

What should happen after installation?

Create the Viewer with a container, await mount(), await ready(), then open a document. Destroy the Viewer when the screen or component that owns it is removed.

/ next step

Open your first document with the Viewer SDK.

/ get started

Ready to put CAD, BIM and PDF inside your app?

Explore documentation