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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tact-js

v2.0.4

Published

![npm](https://img.shields.io/npm/v/tact-js) ![license](https://img.shields.io/npm/l/tact-js) ![CI](https://github.com/bhaptics/tact-js/workflows/CI/badge.svg) ![Code Quality](https://github.com/bhaptics/tact-js/workflows/Code%20Quality/badge.svg) ![npm d

Readme

npm license CI Code Quality npm downloads

bHaptics Web SDK

Web-based haptic control library for bHaptics devices. A variety of haptic events can be played in your browser.

  • Written in TypeScript
  • Supports ESM

✨ Features

🎮 Play events

Play haptic event exported from bHaptics developer portal

video

🔵 Dot mode

Play single-frame feedback with intensity-mapped dot values

dot-mode

🧭 Path mode

Play directional feedback across the surface of a device

path-mode

📦 Installation

npm install tact-js
# or
yarn add tact-js
# or
pnpm add tact-js

🚀 Quick Start

Prerequisite

  1. Download and install the bHaptics Player
  2. Make sure the Player is running
  3. Connect your bHaptics Device to the Player
  4. Ensure the Player version is vX.Y.Z or later

Usage

Initialize the library

import Tact from 'tact-js';

// Initialize the library
Tact.init({
  appId: '<APP_ID>',
  apiKey: '<API_KEY>',
});

Play an event

import Tact, { PositionType } from 'tact-js';

// Play an event
Tact.play({ eventKey: key });

Play dot mode

import Tact, { PositionType } from 'tact-js';

// Play a dot
Tact.playDot({
  position: PositionType.Vest,  // e.g., Vest, Head, ForearmL, ForearmR etc.
  motorValues: [100, 0, ... , 0], // 0 ~ 100
});

Play path mode

import Tact, { PositionType } from 'tact-js';

// Play a path
Tact.playPath({
  position: PositionType.Vest,  // e.g., Vest, Head, ForearmL, ForearmR etc.
  x: [0.4, 0.42, ... , 1], // 0 ~ 1
  y: [0.5, 0.52, ... , 1], // 0 ~ 1
  intensity: [100, 89, ... , 49], // 0 ~ 100
});

📚 API

Tact.init(params: InitParams): void

  • Initialize the library
  • params:
    • appId: string - Your application ID
    • apiKey: string - Your API key
    • remote?: string - (Optional) Remote IP address and Port number of the bHaptics Player (ex. "192.168.0.123:15881")

Tact.play(params: PlayParams): void

  • Play an event
  • params:
    • eventKey: string - Event key
    • startTime?: number - Start time in milliseconds
    • intensityRatio?: number - Intensity ratio
    • durationRatio?: number - Duration ratio
    • offsetX?: number - Offset X
    • offsetY?: number - Offset Y

Tact.playDot(params: PlayDotParams): void

  • Play a dot
  • params:
    • position: PositionType - Position type
    • motorValues: number[] - Motor values
    • duration?: number - Duration in milliseconds

Tact.playPath(params: PlayPathParams): void

  • Play a path
  • params:
    • position: PositionType - Position type
    • x: number[] - X values
    • y: number[] - Y values
    • intensity: number[] - Intensity values
    • duration?: number - Duration in milliseconds

🛠 Troubleshooting

Vite

If you are using Vite, you may need to add the following to your vite.config.js file:

export default defineConfig({
  // ...
  optimizeDeps: {
    exclude: ['tact-js'],
  },
  // ...
});

Demo

  • Online demo: tact-js
  • Local demo: Check the demo/ directory for a minimal setup example

🪪 License

bHaptics License