Message APINPM Package/docs/getting-started/npm-examples

NPM Examples

Runnable Rasterex Viewer examples for common NPM integration patterns.

Start With The Examples Repository

Start with Rasterex Viewer Examples to use a runnable NPM integration instead of assembling a project from individual snippets.

The examples are maintained as runnable applications and are useful when you want to compare setup, viewer initialization, file loading, event handling, and component workflows in context.

  • Start with the example closest to your framework and then copy only the viewer setup and workflow code that applies to your application.
  • Use the component documentation in this site for the detailed API contract behind each example workflow.

Typical Setup

Most NPM examples follow the same high-level setup: install the viewer package, create a viewer container, initialize the viewer from client-side code, open a file, and subscribe to events needed by your UI.

npm install @rasterex/viewer
Typical Setup

When To Use The Examples

Use the examples when you need a complete reference for project wiring, lifecycle handling, and practical UI flows.

  • New application setup: copy the project structure and viewer initialization pattern.
  • Framework integration: compare how the viewer is mounted and cleaned up in the selected framework.
  • Feature workflows: review working file, annotation, measurement, calibration, PDF, CAD, and collaboration flows.
  • Troubleshooting: compare your setup against a known working application.