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

@antpb/xr-publisher

v0.1.0

Published

XR Publisher is a powerful JavaScript library for creating immersive 3D virtual worlds with support for VR, networking, and AI-powered NPCs. Built on top of React and Three.js, it provides a declarative way to build interactive 3D environments.

Readme

XR Publisher

XR Publisher is a powerful JavaScript library for creating immersive 3D virtual worlds with support for VR, networking, and AI-powered NPCs. Built on top of React and Three.js, it provides a declarative way to build interactive 3D environments.

STILL IN DEVELOPMENT USE AT YOUR OWN RISK OF FREQENT CHANGES - DEVELOPMENT IS ON THE BRANCH "development" wait until there is a release before using in production

Features

  • Virtual Reality Support: Built-in VR compatibility with device targeting
  • Multiplayer Networking: Support for multi-user environments with voice chat capabilities
  • AI-Powered NPCs: Integration with AI characters that can interact with users
  • Physics Engine: Integrated physics system for realistic object interactions
  • Component-Based Architecture: Modular design using custom HTML elements
  • Asset Management: Support for various 3D models, textures, and audio
  • Environment Controls: Camera collisions, teleportation, and player movement
  • Customizable Avatars: VRM model support for player avatars

Installation

Quick Start

  1. Import the library:
import { XRPublisher } from 'xr-publisher';
  1. Initialize with your configuration:
const publisher = new XRPublisher({
    threeObjectPlugin: 'path/to/plugin',
    defaultAvatarAnimation: '',
    defaultAvatar: 'path/to/default/avatar.vrm',
    multiplayerAccess: 'loggedIn',
    camCollisions: true,
    enableAI: true,
    enableNetworking: false,
    enableVoiceChat: false
});

publisher.init();

Building a World

Worlds are constructed using custom HTML web componentsgit. Here's a basic example:

<three-environment-block 
    devicetarget="vr" 
    threeobjecturl="path/to/world.glb"
    scale="1" 
    positiony="-1" 
    rotationy="0" 
    animations="" 
    camcollisions="1">
    
    <!-- Networking configuration -->
    <three-networking-block 
        participantlimit="5" 
        customavatars="1">
    </three-networking-block>
    
    <!-- 3D Models -->
    <three-model-block 
        threeobjecturl="path/to/model.glb"
        scalex="1" 
        scaley="1" 
        scalez="1" 
        positionx="0" 
        positiony="0" 
        positionz="0"
        animations="" 
        collidable="1">
    </three-model-block>
    
    <!-- Sky configuration -->
    <three-sky-block 
        distance="170000" 
        rayleigh="1" 
        sunpositionx="0" 
        sunpositiony="1" 
        sunpositionz="-10000">
    </three-sky-block>
</three-environment-block>

Available Components

Environment Block

The main container for your 3D world:

<three-environment-block>
    <!-- World contents go here -->
</three-environment-block>

Attributes:

  • devicetarget: Set to "vr" for VR support
  • threeobjecturl: URL to the main world model (GLB format)
  • scale: World scale factor
  • positiony: Vertical position
  • rotationy: Rotation around Y axis
  • camcollisions: Enable/disable camera collisions

Networking Block

Enables multiplayer functionality:

<three-networking-block>
</three-networking-block>

Attributes:

  • participantlimit: Maximum number of concurrent users
  • customavatars: Enable custom avatar uploads

Model Block

Add 3D models to your world:

<three-model-block>
</three-model-block>

Attributes:

  • threeobjecturl: URL to the model file
  • scalex/y/z: Scale in each dimension
  • positionx/y/z: Position in 3D space
  • rotationx/y/z: Rotation around each axis
  • animations: Animation names to play
  • collidable: Enable physics collisions

NPC Block

Add interactive AI characters:

<three-npc-block
    threeobjecturl="path/to/avatar.vrm"
    name="NPCName"
    defaultmessage="Hello!"
    personality="..."
    objectawareness="1">
</three-npc-block>

Additional Components

  • <three-sky-block>: Configure skybox and lighting
  • <three-audio-block>: Add spatial audio
  • <three-video-block>: Add video elements
  • <three-image-block>: Add image planes
  • <three-text-block>: Add 3D text
  • <three-portal-block>: Create teleport points

Physics and Collisions

The library includes a physics system based on Rapier. To make objects collidable:

  1. Set the collidable attribute on model blocks
  2. Enable camera collisions with camcollisions="1"
  3. Physics will automatically initialize when the world loads

Avatar System

Players can customize their appearance using VRM models:

  • Default avatar can be specified in configuration
  • Custom avatar URLs can be provided if enabled
  • Avatars support animations and physics interactions

Advanced Features

AI NPCs

NPCs can be configured with personality traits and conversation topics:

@todo HIGH RISK TO CHANGE SOON: update to offer the ability to point to the new Character API to create NPCs

const npcConfig = {
    name: "Character",
    topics: ["topic1", "topic2"],
    personality: {
        adjectives: ["friendly", "helpful"],
        style: {
            chat: ["Be enthusiastic", "Use emojis"]
        }
    }
};

Networking

For multiplayer environments:

  1. Enable networking in configuration
  2. Set participant limits
  3. Configure voice chat settings
  4. Handle player synchronization automatically (TODO: need to write up the p2pcf setup or offer the public one)

Browser Support

  • Modern browsers with WebGL support
  • WebXR-compatible browsers for VR features
  • Mobile support with touch controls

License

GPL-3.0

Support

For questions and support:

  • File an issue on GitHub