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

@pulzr/perses-pulzr-datasource

v0.3.0

Published

Pulzr Net datasource for Perses: sensor readings, SQL, analytics, field changes and devices

Readme

Pulzr Net datasource for Perses

Sensor readings from Pulzr Net on Perses dashboards: the same data, aggregates and analytics the Pulzr console draws, in your own Perses.

| Plugin | Kind | What it does | |---|---|---| | PulzrDatasource | Datasource | Where Pulzr Net is, and how requests reach it | | PulzrFieldQuery | TimeSeriesQuery | Decoded fields, bucketed and aggregated (mean, time-weighted mean, min, max, p95, rises, …), with an optional target band, display names, a scale, and device positions for a map | | PulzrSqlQuery | TimeSeriesQuery | A read-only SQL SELECT over your readings, $from and $to set to the dashboard's range | | PulzrMetricQuery | TimeSeriesQuery | Occupancy rate, turnover, dwell and sensors reporting over time; occupancy by weekday and hour as a grid in metadata.matrix; a parking sensor's figures (parking: occupied, stays, typical and longest stay) and categories (arrivalsByHour, stayLengths) as a series each, one point at the range's end. lookback (28d) reads that far back from the range's end, for a weekly pattern on a board showing a day; hours and weekdays are counted in the viewer's timezone | | PulzrChangeAnnotation | Annotation | Marks every change of up to four fields, such as a recipe stage or a mode | | PulzrDeviceVariable | Variable | The devices heard in the last 30 days, by name |

Every request is made as the API key or signed-in user behind it, with the same organization, application and retention limits as the Pulzr console.

Use it in Perses

  1. In Pulzr Net, open API keys and create a key with Data: Read and Devices: Read, limited to the applications the dashboards should see.

  2. Put the plugin archive (PulzrDatasource-<version>.tar.gz, from this repository's releases) in a folder listed in the Perses server's plugin.archive_paths.

  3. Store the key as a Perses secret:

    kind: GlobalSecret
    metadata:
      name: pulzr-api-key
    spec:
      authorization:
        type: Bearer
        credentials: pzk_…
  4. Add the datasource. The Perses server calls Pulzr Net and adds the key, so it never reaches a viewer's browser:

    kind: GlobalDatasource
    metadata:
      name: pulzr
    spec:
      default: true
      plugin:
        kind: PulzrDatasource
        spec:
          proxy:
            kind: HTTPProxy
            spec:
              url: https://app.pulzr.net
              secret: pulzr-api-key
              allowedEndpoints:
                - { endpointPattern: /api/v1/data/query, method: POST }
                - { endpointPattern: /api/v1/data/analytics, method: POST }
                - { endpointPattern: /api/v1/data/devices, method: GET }
                - { endpointPattern: /api/v1/data/devices/live, method: GET }
                - { endpointPattern: /api/v1/data/fields, method: GET }

A panel query looks like this:

kind: TimeSeriesQuery
spec:
  plugin:
    kind: PulzrFieldQuery
    spec:
      field: temperature
      aggregate: timeWeighted
      interval: 15m
      devices: $device

devices is DevEUIs or a variable holding them; empty is every device. The schemas in schemas/ are the full specification of each plugin.

Embed it in a React app

The package also exports every plugin for apps that embed Perses directly, as the Pulzr console does:

npm install @pulzr/perses-pulzr-datasource
import * as pulzr from '@pulzr/perses-pulzr-datasource';

const pluginLoader = dynamicImportPluginLoader([
  { resource: pulzr.getPluginModule(), importPlugin: async () => pulzr },
]);

With directUrl the browser calls Pulzr Net itself, through the fetch from Perses's FetchProvider. Wrap the dashboard in a FetchProvider that adds your sign-in to each request.

Development

Node.js 24 or later, npm 11 or later, and percli.

npm install
npm test                     # unit tests
percli plugin test-schemas   # CUE schema tests
percli plugin lint
npm run build                # the npm package and module-federation bundle, in dist/
percli plugin build          # the archive a Perses server installs

Releasing

Set the new version in package.json and commit. Write the release notes in notes.md, then tag with them as the tag's message and push it:

git tag -a v0.2.0 --cleanup=whitespace -F notes.md && git push origin v0.2.0

The tag's message is the GitHub release's notes; with none, the workflow falls back to GitHub's generated notes, and fails if those are empty too.

The Release workflow tests and builds, publishes the package to npm with provenance, and attaches the Perses plugin archive and the npm tarball to a GitHub release.

License

Apache 2.0