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

@studiisapp/beta

v1.0.2

Published

A flexible, secure, and extensible authentication plugin designed for beta access management. This plugin allows you to gate sign-ups behind beta codes, manage invite flows, and add custom fields or logic for your application's early access program.

Readme

Better Auth Beta Plugin

A flexible, secure, and extensible authentication plugin designed for beta access management. This plugin allows you to gate sign-ups behind beta codes, manage invite flows, and add custom fields or logic for your application's early access program.


Features

  • Restrict sign-up to users with valid beta codes or wildcard access
  • Add and remove beta users via API endpoints
  • Send custom invite links to users
  • Support for additional fields in beta user schema
  • Secure middleware to enforce beta access at sign-up
  • Extensible with custom code generation and email logic
  • Built on top of the better-auth ecosystem

Installation

npm install @studiisapp/beta


Usage

import { betaPlugin } from '@studiisapp/beta';

plugins: [
	betaPlugin({
		enabled: true,
		sendInviteLink: async ({ email, url, code }) => {
			await sendBetaInviteEmail({
				mailTo: email,
				betaKey: code,
				url,
			});
		},
		betaSecret: process.env.BETA_SECRET || "",
	}),
]

Endpoints

| Endpoint | Method | Description | |-------------------------|--------|---------------------------------------------| | /beta/add-user | POST | Add a beta user or wildcard code | | /beta/remove-user | DELETE | Remove a beta user (not yet implemented) | | /beta/sign-up/:code | GET | Callback for beta code sign-up | | /beta/sign-up | POST | Complete sign-up with beta code | | /beta/check | GET | Check if a beta code is valid |


How It Works

  • Beta Gating: The plugin enforces beta access at the sign-up endpoint using a secret header (X-Beta-Signup). Only requests with the correct secret are allowed to proceed.
  • Invite Flow: Admins can add users to the beta list, generating unique codes and sending invite links via email.
  • Wildcard Codes: Supports "wildcard" codes for broader access (e.g., public beta).
  • Custom Fields: Extend the beta user schema with additional fields as needed for your use case.
  • Secure Callbacks: Redirects and error handling are built-in for a smooth user experience.

Configuration Options

| Option | Type | Description | |--------------------|------------|--------------------------------------------------| | enabled | boolean | Enable or disable the beta plugin | | betaSecret | string | Secret required in X-Beta-Signup header | | sendInviteLink | function | Custom function to send invite emails | | additionalFields | object | Extra fields to add to the beta user schema | | generateCode | function | Custom function to generate invite codes | | schema | object | Custom schema overrides |


Error Codes

  • USER_EXISTS: User already exists in the beta
  • USER_NOT_FOUND: User does not have beta access
  • INVALID_CODE: Invalid or expired beta code

Extending

You can customize invite links, code generation, and schema fields to fit your application's needs. See the betaPlugin options for details.


License

MIT


Contributing

Contributions and feedback are welcome! Please open issues or pull requests for improvements or bug fixes.


Disclaimer

This plugin is designed for beta access use cases and should be integrated with proper security and validation according to your application's requirements.


For more details, see the source code and inline documentation.