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

@sendlix/group

v1.0.0

Published

Sendlix Group SDK – subscribe users to mailing groups with optional Proof-of-Work bot protection.

Readme

@sendlix/group

Subscribe users to Sendlix mailing groups – with optional Proof-of-Work bot protection and ready-made React components.

npm license

Installation

npm install @sendlix/group

React components are included in the same package and available via the /react sub-path:

# No extra install needed – React is a peer dependency
npm install react

Quick start

Subscribe an email address

import { subscribeToGroup } from "@sendlix/group";

const result = await subscribeToGroup({
  id: "your-group-id",
  email: "[email protected]",
});
// { success: true, code: 0, message: "Email added to group" }

With Proof-of-Work bot protection

import { subscribeToGroup, ProofOfWork } from "@sendlix/group";

const pow = new ProofOfWork("your-group-id");

// Pre-warm the WebGPU pipeline (optional, call on page load)
pow.init();

const { token, nonce } = await pow.solve("[email protected]");

const result = await subscribeToGroup({
  id: "your-group-id",
  email: "[email protected]",
  botProtection: { type: "proofOfWork", token, nonce },
});

// Release resources when done
pow.close();

With template placeholders

await subscribeToGroup({
  id: "your-group-id",
  email: "[email protected]",
  substitute: {
    "##First Name##": "Alice",
    "##Last Name##": "Smith",
  },
});

React components

GroupIframe – embed the hosted form

import { GroupIframe } from "@sendlix/group/react";

<GroupIframe
  id="your-group-id"
  appearance={{
    primaryColor: "oklch(0.65 0.12 87)",
    backgroundColor: "white",
    textColor: "black",
    name: "Newsletter",
    info: "No spam, unsubscribe at any time.",
  }}
/>;

The iframe resizes automatically when the hosted form changes height. All standard <iframe> attributes are forwarded.

| Prop | Type | Default | Description | | ------------- | ------------ | ------- | --------------------------- | | id | string | – | Group ID | | appearance | Appearance | – | Visual customisation | | startHeight | number | 500 | Initial iframe height in px |

ProofOfWorkInput – drop-in email input with PoW

A replacement for <input type="email"> that automatically runs the Proof-of-Work challenge on blur and injects hidden pow-token / pow-nonce fields into the surrounding <form>.

import { ProofOfWorkInput } from "@sendlix/group/react";

function SubscribeForm() {
  const [status, setStatus] = useState<string>();

  return (
    <form method="POST" action="https://group.sendlix.com/your-group-id">
      <ProofOfWorkInput
        sendlix={{ id: "your-group-id", onStatusChange: setStatus }}
        placeholder="[email protected]"
        required
      />
      {status === "loading" && <span>Solving challenge…</span>}
      {status === "processing" && <span>Renewing token…</span>}
      {status === "success" && <span>Ready</span>}
      {status === "error" && <span>PoW failed</span>}
      <button type="submit">Subscribe</button>
    </form>
  );
}

| Prop | Type | Description | | ------------------------ | ----------------------------- | --------------------------------- | | sendlix.id | string | Group ID | | sendlix.onStatusChange | (status: PowStatus) => void | Called on every status transition |

All standard <input> attributes are forwarded to the underlying email input.


API reference

subscribeToGroup(options)

subscribeToGroup(options: {
  id:              string;
  email:           string;
  substitute?:     Record<string, string>;
  botProtection?:  { type: "proofOfWork"; token: string; nonce: string };
}): Promise<GroupResponse>

subscribeToGroupWithFormData(data, id, substitute?)

subscribeToGroupWithFormData(
  data:       FormData,
  id:         string,
  substitute?: Record<string, string>,
): Promise<GroupResponse>

Use this when you already have a native <form> and control the FormData yourself.

ProofOfWork

const pow = new ProofOfWork(groupId: string, options?: PowOptions);

Options

| Option | Type | Description | | ---------------- | ----------------------------- | ------------------------------------------------------- | | onStatusChange | (status: PowStatus) => void | Called on every status change | | onRenew | (result: PowResult) => void | Called when the token is silently renewed before expiry |

Methods

| Method | Returns | Description | | ------------------ | -------------------- | ---------------------------------------------------------------------- | | pow.solve(email) | Promise<PowResult> | Requests a challenge and solves it. Schedules automatic renewal. | | pow.init() | void | Pre-warms the WebGPU pipeline. Call on component mount. | | pow.close() | void | Cancels the renewal timer and releases GPU resources. Call on unmount. |

Uses WebGPU when available for GPU-accelerated solving, with an automatic fallback to the Web Crypto API (CPU).

Types

type PowResult = { token: string; nonce: string };
type PowStatus = "loading" | "processing" | "success" | "error";

type GroupResponse = {
  success: boolean;
  code: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
  message: string;
};

Development

npm install        # install dependencies
npm test           # run Jest test suite
npm run build      # compile TypeScript → ./dist

Releases

Releases are automated via semantic-release on every push to main. Use Conventional Commits for your commit messages:

| Prefix | Release type | | ----------------------------- | ------------- | | fix: | Patch (0.0.x) | | feat: | Minor (0.x.0) | | feat!: / BREAKING CHANGE: | Major (x.0.0) |

Required repository secrets: NPM_TOKEN.

License

Apache License 2.0. See LICENSE for details.