Installation

Add @interfaces-technology/play-u1 to any app that runs in the browser (or uses client components in frameworks like Next.js). You do not need a clone of this repo to use the library.

Just reading? Open the live docs—no install required.

Install from npm

npm install @interfaces-technology/play-u1

The package is on the public npm registry under the @interfaces-technology scope. No token is required for this package alone.

When npm install cannot find the package

If your machine or CI maps @interfaces-technology to a different registry, add a project .npmrc next to package.json:

@interfaces-technology:registry=https://registry.npmjs.org/

Common mistakes: the file must be named .npmrc (leading dot). In a monorepo, put it next to the workspace root that runs npm install / npm ci, not only inside a nested app folder unless installs always run from there.

Check where npm resolves this scope

From the consuming repo root (next to its package.json):

npm config get @interfaces-technology:registry
npm config get @interfaces-technology:registry --location=user
  • If --location=user is not https://registry.npmjs.org/, your user config affects every project. Fix ~/.npmrc or override with the project .npmrc above.
  • If the default is fine but install still fails, look for typos, network/proxy issues, or a lockfile pinning a bad URL.

pnpm: same @interfaces-technology:registry=... line in .npmrc at the install root.

Yarn Berry (.yarnrc.yml) — scope key is without @:

npmScopes:
  interfaces-technology:
    npmRegistryServer: "https://registry.npmjs.org/"

Tarball install (bypasses scope config)

If you cannot fix registry mapping quickly, install straight from the public tarball (change the version if needed):

npm install https://registry.npmjs.org/@interfaces-technology/play-u1/-/play-u1-0.1.10.tgz

You will still want a correct .npmrc so the next npm install does not break again.

Which import should I use?

You needImport from
Manager, layouts, gestures, readPads from the Gamepad API@interfaces-technology/play-u1
React 18+ hooks ("use client" in Next.js)@interfaces-technology/play-u1/react
WebHID pairing helpers (Chromium) + readPads / PadSnap@interfaces-technology/play-u1/hid

Core (no React):

import { createGamepadManager, readPads } from "@interfaces-technology/play-u1";

React (optional peer react ≥ 18):

import { useGamepadManager } from "@interfaces-technology/play-u1/react";

WebHID (optional):

import {
  supportsWebHid,
  requestGamepadHidDevice,
  readPads,
  type PadSnap,
} from "@interfaces-technology/play-u1/hid";

Use the root import when the manager and snapshots are enough. Use /hid when you also need WebHID pairing or want HID-related types in one module.

Next: Quick start · API reference

Docs inside Cursor or other assistants

Guides and TypeDoc are also exposed over MCP at https://play-u1.vercel.app/api/mcp (Streamable HTTP). Use that when you want an agent to search this documentation from a URL.