0.6.0 • Published 1 year ago

@unavi/react-client v0.6.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
1 year ago

React Client

React components and hooks for running a UNAVI client.

Installation

pnpm install @unavi/react-client

Usage

The Client component is a self-contained client for UNAVI. It manages the connection to the host and renders the scene. Components can be passed in as children, and can access internal state using the ClientContext (for example, if you want to send messages to the host using the WebSocket connection).

import { Client } from "@unavi/react-client";

export default function App() {
  return (
    <Client
      uri="https://path.to/space.glb"
      metadata={{...}}
      host="wss://host.unavi.xyz"
      skybox="/skybox.jpg"
      defaultAvatar="/default-avatar.vrm"
      animations="/animations"
    />
  );
}