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

@mappedin/mappedin-js

v6.16.0

Published

- [Getting Started Guide](https://developer.mappedin.com/web-sdk/getting-started) - [API Reference](https://docs.mappedin.com/web/v6/latest/) - [Mappedin Developer Portal](https://developer.mappedin.com) - [Demo Keys & Maps](https://developer.mappedin.com

Readme

Mappedin JS

Resources

AI Assistants: Before generating code, read llms.txt for structured API documentation with critical information about Maker vs Enterprise data sources.

Usage

Installation

npm install @mappedin/mappedin-js

or

yarn add @mappedin/mappedin-js

Getting Started

import { getMapData, show3dMap } from '@mappedin/mappedin-js';

async function init() {
	const mapData = await getMapData({
		key: '<key>',
		secret: '<secret>',
		mapId: '<mapId>',
	});
	const mapContainer = document.getElementById('app');
	const map = await show3dMap(mapContainer, mapData);
	map.Labels.__EXPERIMENTAL__all();
	map.on('click', event => {
		const { coordinate } = event;
		const { latitude, longitude } = coordinate;
		console.log(`Map was clicked at ${latitude}, ${longitude}`);
	});
}
init();

For full documentation, read our Getting Started guide on the Developer Portal.

Content Security Policy (CSP) Support

The SDK provides solutions for applications that use a strict Content Security Policy.

Minimum Required CSP Rules

The following CSP directives are the minimum requirements to run the SDK:

| Purpose | CSP Directive | Required Value | Notes | | ---------------------- | ------------- | ---------------------- | -------------------------------------------------------------------- | | Images & Textures | img-src | *.mappedin.com data: | Required for loading map textures and images | | API & Font Loading | connect-src | *.mappedin.com data: | *.mappedin.com for map data; data: only needed for default fonts | | Web Workers | worker-src | 'self' blob: | Enables collision detection and MapLibre workers |

Example minimum CSP header:

Content-Security-Policy: img-src *.mappedin.com data:; connect-src *.mappedin.com data:; worker-src 'self' blob:;

Alternative for strict CSP environments: If your CSP does not allow blob:, you can set up a transparent proxy on your server that forwards requests from https://YOUR.DOMAIN/mappedin-web-redirector/* to https://cdn.mappedin.com/web2/release/*. This removes the need for additional CSP rules while maintaining functionality.

Web Worker CSP Solution

If your CSP blocks blob: URLs or unsafe-eval directives (affecting web workers), you can host worker scripts externally:

import { setWorkersUrl } from '@mappedin/mappedin-js';

// Call this before initializing any maps
setWorkersUrl('/path/to/workers');

This function configures both the MapLibre and collision detection workers to load from external URLs. To set this up:

  1. Copy the worker files from node_modules/@mappedin/mappedin-js/lib/esm/workers/ to your web server:
    • collision-worker.csp.js
    • maplibre-worker.csp.js
  2. Call setWorkersUrl with the base URL path to these files
  3. Ensure your CSP allows scripts from this location

Example in a build script:

# Copy worker files to your public directory
cp -r node_modules/@mappedin/mappedin-js/lib/esm/workers ./public/mappedin-workers
// In your JavaScript
setWorkersUrl('/mappedin-workers');

CSS Injection CSP Solution

If your CSP blocks inline styles (style-src 'unsafe-inline'), use external CSS loading instead:

  1. Load the SDK's CSS with a <link> tag in your HTML
  2. Disable automatic style injection in show3dMap options
<!-- In your HTML file -->
<link rel="stylesheet" href="/path/to/mappedin-js/index.css" />
// In your JavaScript
const mapView = await show3dMap(element, venue, {
	injectStyles: false, // Disable automatic style injection
});

For your build process:

# Copy CSS file to your public directory
cp node_modules/@mappedin/mappedin-js/lib/esm/index.css ./public/

Text3D Worker CSP Solution (Optional)

If you use Text3D features (like labelAll()) in a CSP-restricted environment, you'll need to disable the Text3D worker if you don't want to see error messages:

import { disableText3DWorker } from '@mappedin/mappedin-js';
// After initializing your map
disableText3DWorker();

// Now you can use Text3D features without errors or warnings
mapView.Text3D.labelAll();

This disables the worker and processes text on the main thread instead, allowing Text3D to work in CSP environments that block worker creation.

You can apply any combination of these solutions based on your specific CSP restrictions and SDK feature usage.