npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@novorender/api

v2.2.11

Published

Novorender web API.

Readme

@novorender/api

Latest NPM Version

This package contains all the various APIs relevant for developing a Novorender web app.

Getting Started

Install @novorender/api using your favorite package manager.

npm i @novorender/api

This npm package contains pre-built ESM bundle and typescript definitions. It is meant to be used with modern javascript bundlers such as vite or webpack or directly in a modern browser.

Avoid deep imports! Everything you need should be available from the package root: @novorender/api.

Development

To build the package, run the following command:

npm run build

This will create a dist folder with the following files:

  • novorender-api.js - the main ESM bundle
  • novorender-api.d.ts - the TypeScript definitions

To run the build in a watch mode, use:

npm run build:watch

This will watch for changes and rebuild the package automatically.

To lint and automatically fix the code with eslint:

npm run lint

To format the code using prettier:

npm run fmt

The package is using pre-commit hooks in order to lint and format the code before committing. This is done using husky and lint-staged.

Dependencies

We use gl-matrix for linear algebra.

Double precision matrices glMatrix.setMatrixArrayType(Array) are required. Don't change back to Float32Array!

Server requirements

Our API uses advanced, cutting edge JavaScript APIs, many of which come with certain security requirements. In general, the following two global properties have to be true: globalThis.isSecureContext and globalThis.crossOriginIsolated.

To make it all work, your server has to ensure:

  1. A secure context. In practice, this means HTTP on localhost (for debugging only) and HTTPS everywhere else, including LAN.

  2. Cross origin HTTP headers for top level documents.

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
  1. Correct MIME types - text/javascript for JavaScript files and application/wasm for WebAssembly files.

  2. Any resources loaded from a separate domain have to be configured with CORS to allow your domain.

  3. The service workers script should be at the appropriate location, preferably at the root of your domain. See MDN for more.

Usage

A minimal app might look something like this:

import { View, getDeviceProfile } from "@novorender/api";

async function main(canvas: HTMLCanvasElement) {
  const gpuTier = 2; // laptop with reasonably new/powerful GPU.
  const deviceProfile = getDeviceProfile(gpuTier);
  const view = await View.create(canvas, deviceProfile);
  await view.run();
  view.dispose();
}

main(document.getElementById("render_canvas"));

If everything succeeds, this should render an image with a minor gradient of gray. To make it a little more interesting, we can change the RenderState to include a grid.

// ... snip...
const view = await View.create(canvas, deviceProfile);
view.modifyRenderState({ grid: { enabled: true } });
await view.run();
// ...snip...

The view already has camera controller built in, so you can move around and enjoy your grid with the mouse and/or keyboard, or even touch gestures.

The view will automatically resize your canvas' pixel size when the css layout and/or the render state output settings changes. This could lead to a runaway recursive feedback loop. To avoid this issue, you must assign a css width and height to your canvas!

<canvas style="width: 100%; height: 100%;"></canvas>

Next steps

Getting that first view up and running is an important step. Now you can actually start to make your application. Please see the documentation for tutorials, examples and a detailed reference manual!