/ guide · integration decision

Rasterex Viewer SDK vs iframe and PostMessage: how to choose.

Choose the integration contract that fits your frontend while keeping CAD, BIM and PDF documents inside your own application and operating model.

/ short answer

The Canvas is the same. The browser integration differs.

Choose @rasterex/viewer when your JavaScript or TypeScript frontend benefits from a Viewer lifecycle, documented commands and events. Choose direct iframe and PostMessage when your page can run browser JavaScript and your team wants to work with the documented message contract directly.

These are not competing Rasterex products. Both embed Canvas in the customer application; the application retains its UI, identity, document access and workflow data.

/ choose by integration boundary

Pick the contract your frontend team can own clearly.

Choose the Viewer SDK

Best when the viewer lives in a JavaScript or TypeScript application and the team wants an NPM package with a documented Viewer lifecycle.

  • Install @rasterex/viewer in the frontend application.
  • Create a Viewer, then await mount() and ready().
  • Use documented Viewer commands and events from application code.
  • Destroy the Viewer when its owning screen or component is removed.

Choose iframe and PostMessage

Best when the host can render HTML and run browser JavaScript, and the team wants to integrate Canvas through standard browser APIs without the NPM SDK abstraction.

  • Render the Canvas iframe in the host page.
  • Attach its load handler before assigning iframe.src.
  • Send the documented view message after Canvas boots.
  • Use an explicit target origin and validate incoming event.origin.

Your backend stack does not decide this alone.

Django, ASP.NET, Laravel, Rails, Spring, PHP and other backend stacks can serve a host application that embeds Canvas. The decision is made at the browser boundary: whether its frontend uses the Viewer SDK or the direct iframe and PostMessage contract.

Customer application

Owns UI, identity, document access and workflow records.

Viewer SDK or iframe

Connects the browser surface to Canvas.

Canvas deployment

Runs with its supporting Rasterex services in the selected environment.

/ validation

Commit to one documented contract per viewer surface.

  • The selected integration matches the frontend team’s ownership and deployment constraints.
  • SDK integrations install the current @rasterex/viewer package and wait for mount() and ready().
  • Iframe integrations use the documented view payload, explicit target origin and incoming-origin validation.
  • The host application continues to control access to documents and its own business workflow.
  • The next workflow guide uses only the API contract selected for that viewer surface.
/ common questions

SDK and iframe integration answers.

Do the Rasterex Viewer SDK and iframe integration use different viewer products?

No. They are two current ways to embed Rasterex Canvas in a host application. The Viewer SDK provides a JavaScript and TypeScript lifecycle and browser-facing commands; the iframe route uses the documented browser PostMessage contract directly.

When should I choose the Rasterex Viewer SDK?

Choose the Viewer SDK when the host frontend is a JavaScript or TypeScript application and the team wants to install @rasterex/viewer, create a Viewer, await mount() and ready(), and use documented commands and events from application code.

When should I use iframe and PostMessage?

Use iframe and PostMessage when the application can render HTML and run browser JavaScript but does not need the NPM SDK abstraction. The host page manages the iframe load order, sends the documented view message, uses an explicit Canvas origin and validates incoming messages.

Can a Django, ASP.NET, PHP or Java application use the Viewer SDK?

Those backend technologies can use either path when their frontend is a JavaScript or TypeScript application. If the host page can run browser JavaScript, the direct iframe and PostMessage path is also available independently of the backend stack.

Do we need to choose one path for the entire product?

Choose one supported integration contract for a given viewer surface and follow its documentation precisely. Both paths embed Canvas; the customer application continues to own UI, identity, document access and workflow data.

/ sources and next step

Continue with the exact contract you chose.

/ get started

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

Explore documentation