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

@felixgeelhaar/govee-api-client

v3.1.14

Published

Enterprise-grade TypeScript client library for the Govee Developer REST API

Readme

Govee API Client

npm version npm downloads CI Known Vulnerabilities License: MIT Node.js TypeScript npm provenance

A TypeScript client for the Govee Developer API. Control your Govee lights, appliances, and other smart devices from code.

Install

npm install @felixgeelhaar/govee-api-client

Getting Started

You'll need a Govee API key. Get one from the Govee Developer Platform.

import { GoveeClient, ColorRgb, Brightness } from '@felixgeelhaar/govee-api-client';

const client = new GoveeClient({ apiKey: 'your-api-key' });

// List your devices
const devices = await client.getDevices();

// Find and control a light
const light = await client.findDeviceByName('Living Room');

if (light) {
  await client.turnOn(light.deviceId, light.model);
  await client.setBrightness(light.deviceId, light.model, new Brightness(75));
  await client.setColor(light.deviceId, light.model, new ColorRgb(255, 120, 50));
}

You can also set the GOVEE_API_KEY environment variable and skip passing it to the constructor:

const client = new GoveeClient(); // reads from GOVEE_API_KEY

What You Can Do

Basic Controls

await client.turnOn(deviceId, model);
await client.turnOff(deviceId, model);
await client.setBrightness(deviceId, model, new Brightness(75));

Colors

import { ColorRgb, ColorTemperature } from '@felixgeelhaar/govee-api-client';

// Set an RGB color
await client.setColor(deviceId, model, new ColorRgb(255, 0, 0));

// Set a color temperature
await client.setColorTemperature(deviceId, model, ColorTemperature.warmWhite());

// Turn on with color and brightness in one call
await client.turnOnWithColor(deviceId, model, new ColorRgb(0, 255, 0), new Brightness(80));

Scenes

import { LightScene } from '@felixgeelhaar/govee-api-client';

// Browse available scenes for a device
const scenes = await client.getDynamicScenes(deviceId, model);

// Apply a built-in scene
await client.setLightScene(deviceId, model, LightScene.sunset());
await client.setLightScene(deviceId, model, LightScene.aurora());

Segments (for LED strips and curtain lights)

import { SegmentColor, ColorRgb } from '@felixgeelhaar/govee-api-client';

await client.setSegmentColors(deviceId, model, [
  new SegmentColor(0, new ColorRgb(255, 0, 0)),
  new SegmentColor(1, new ColorRgb(0, 255, 0)),
  new SegmentColor(2, new ColorRgb(0, 0, 255)),
]);

Music Mode

import { MusicMode } from '@felixgeelhaar/govee-api-client';

await client.setMusicMode(deviceId, model, new MusicMode(1, 75));

Toggles

await client.setNightlightToggle(deviceId, model, true);
await client.setGradientToggle(deviceId, model, true);
await client.setSceneStageToggle(deviceId, model, true);

Device State

const state = await client.getDeviceState(deviceId, model);

console.log(state.getPowerState());    // true / false
console.log(state.isOnline());         // true / false
console.log(state.getBrightness());    // 0-100

Configuration

const client = new GoveeClient({
  apiKey: 'your-api-key',
  timeout: 30000,           // request timeout in ms (default: 30000)
  rateLimit: 95,            // requests per minute (default: 95)
  enableRetries: true,      // retry failed requests (default: false)
  retryPolicy: 'production', // 'development', 'testing', or 'production'
});

Rate Limiting

The client automatically stays within Govee's API rate limits (100 requests/min). By default it allows 95 requests/min, leaving a small buffer.

Retries

When enabled, failed requests are retried with exponential backoff. The built-in presets handle common scenarios:

  • production — 3 attempts, circuit breaker enabled
  • development — 5 attempts, circuit breaker disabled
  • testing — 2 attempts, conservative settings

You can also pass a custom RetryPolicy instance for full control. See the examples for details.

Error Handling

import {
  GoveeApiError,
  InvalidApiKeyError,
  RateLimitError,
  NetworkError,
} from '@felixgeelhaar/govee-api-client';

try {
  await client.turnOn(deviceId, model);
} catch (error) {
  if (error instanceof InvalidApiKeyError) {
    console.log('Check your API key');
  } else if (error instanceof RateLimitError) {
    console.log(`Too many requests. Retry in ${error.getRetryAfterMs()}ms`);
  } else if (error instanceof NetworkError) {
    console.log('Network issue — retryable:', error.isRetryable());
  } else if (error instanceof GoveeApiError) {
    console.log('API error:', error.message);
  }
}

Requirements

Development

npm install
npm run build
npm test
npm run test:coverage

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

License

MIT