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.
Install the documented package.
Install the Viewer SDK
$ npm install @rasterex/viewerThe 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.
Create, mount and wait for Canvas
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.
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.
