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

@layer-drone/protocol

v0.8.0

Published

Layer Drone protocol SDK with typed API client and event parsing

Readme

LayerDrone Protocol SDK

Published as @layer-drone/protocol.

Description

This SDK provides a typed client for using LayerDrone's REST API and parsing webhook events.

Philosophy

The LayerDrone protocol exists as a hybrid of on and off-chain functionality. This helps strike the right balance of transparency, speed, and familiarity.

  • Objects related to missions & reward entitlement are recorded on-chain
  • Off-chain indexing supports non-critical data outside of smart contracts, keeping gas usage low
  • A REST API and webhook broadcaster offer a familiar facade over aggregated on & off-chain data

Installation

$ npm install @layer-drone/protocol

Usage

Getting an API key

Organizations and API keys are provisioned manually for private use only at the moment.

Making API calls

import * as LayerDrone from "@layer-drone/protocol";

const client = LayerDrone.createClient({
  baseUrl: env.PROTOCOL_API_URL,
  auth: env.PROTOCOL_API_KEY,
});

// Submit a flight for validation
const response = await LayerDrone.flightsControllerValidateFlight({
  client,
  body: {
    storageKey: "s3://layerdrone-flights-staging/12345",
    pilotAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
    missionId: 123n,
    flightTimestamp: "2023-10-15T14:25:30.123Z",
    flightRequestInfo: {
      flightPlanId: 2,
      filePaths: [
        "images/IMG_0001.JPG",
        "images/IMG_0002.JPG",
        "images/IMG_0003.JPG",
      ],
      zoneHash: "https://explorer.spexi.com/zone/8928de8de43ffff",
      provenancePath: "provenance.json",
    },
  },
});

Registering webhooks

The SDK supports registering webhooks via the API.

import * as LayerDrone from "@layer-drone/protocol";

const client = LayerDrone.createClient({
  baseUrl: process.env.PROTOCOL_API_URL!,
  auth: process.env.PROTOCOL_API_KEY!,
});

const webhook = await LayerDrone.webhooksControllerCreate({
  client,
  path: { org_id: 1 },
  body: {
    name: "MyOrg Webhook",
    url: "https://api.example.com/webhooks/layer-drone",
    event_types: ["protocol.flight.reviewed"],
    active: true,
  },
});

// `webhook.id` is the config id. `webhook.secret` is the value LayerDrone
// will send on each request as the X-Webhook-Secret header.

Receiving webhook events

Your API can parse webhook payloads at a registered endpoint.

import type { Request, Response } from "express";

import { parseWebhookEvent } from "@layer-drone/protocol";

class MyController {
  async handleLayerDroneWebhookEvent(req: Request, res: Response) {
    const event = parseWebhookEvent(req, process.env.LAYERDRONE_WEBHOOK_SECRET);

    let message = "Event received";
    switch (event.event_type) {
      case "protocol.flight.reviewed":
        // handle narrowed event type.
        break;
      default:
        message = `Handler for ${event.event_type} not implemented`;
    }

    res.status(200).send({ message });
  }
}