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

@varshylinc/onboarding-consent-engine

v0.2.3

Published

Onboarding and legal consent for web + mobile apps: Terms/Privacy acceptance, GDPR/CCPA-style data-use consent, an audit trail, and a ready-made signup consent block.

Readme

@varshylinc/onboarding-consent-engine

Onboarding and legal consent for web + mobile apps: Terms/Privacy acceptance, GDPR/CCPA-style data-use consent, an audit trail, and a ready-made signup consent block.

npm license

Part of the Varshyl Toolkit — a set of independent, composable packages for building Capacitor + web SaaS apps.

Screenshots

Hybrid signup consent: Terms and Privacy as linked text, plus a separate optional checkbox that starts unchecked.

Signup consent block with Terms/Privacy links and an unchecked optional AI-training checkbox

The AI-training choice is explicit and off by default — the pattern auditors expect for secondary data use.

What it does

Collects and audits user consent at signup and onboarding. Stores an append-only consent history with version tracking when policy text changes. Ships React components for a first-run welcome screen, policy-update modals, and a hybrid signup block (implied Terms/Privacy + explicit AI-training checkbox). Your app owns authentication and user creation — this module only records consent.

Install

npm install @varshylinc/onboarding-consent-engine

Peer dependency: react (client). Server side uses pg (included as a dependency).

Quick start

Server — migrate, seed definitions, create the module:

import { Pool } from 'pg';
import {
  runMigrations,
  seedStandardConsents,
  createConsentModule,
} from '@varshylinc/onboarding-consent-engine';

const pool = new Pool({ connectionString: process.env.DATABASE_URL });
await runMigrations(pool);
await seedStandardConsents(pool, 'YourApp');

const consent = createConsentModule({ pool });

// At signup
await consent.recordSignupConsents({
  userId: String(user.id),
  consents: [
    { key: 'terms_of_service', granted: true },
    { key: 'privacy_policy', granted: true },
    { key: 'ai_training', granted: false },
  ],
  ipAddress: req.ip,
  userAgent: req.headers['user-agent'],
});

Client — signup consent block + payload helper:

import { useState } from 'react';
import {
  SignupConsentBlock,
  buildSignupConsentsPayload,
} from '@varshylinc/onboarding-consent-engine/client';

function SignupForm() {
  const [aiTraining, setAiTraining] = useState(false);

  return (
    <>
      <SignupConsentBlock
        termsUrl="/legal/terms"
        privacyUrl="/legal/privacy"
        aiTrainingChecked={aiTraining}
        onAiTrainingChange={setAiTraining}
        actionPhrase="creating your account"
      />
      {/* on submit: buildSignupConsentsPayload({ aiTrainingGranted: aiTraining }) */}
    </>
  );
}

Entry points

| Import path | Exports | |---|---| | @varshylinc/onboarding-consent-engine | runMigrations, createConsentModule, seedStandardConsents, STANDARD_CONSENTS, applyProductName, buildSignupConsentsPayload, types | | @varshylinc/onboarding-consent-engine/client | ConsentCheckbox, ConsentBlock, WelcomeScreen, EmptyState, ConsentUpdateModal, SignupConsentBlock, consentActions, recordSignupConsentsAction, … |

Database

Bring your own Postgres. Call runMigrations(pool) on boot, then seedStandardConsents(pool, productName) (idempotent). Tables use the oce_ prefix (oce_consent_definitions, oce_user_consents, oce_consent_version_log). user_id is stored as TEXT — stringify your app's primary key before passing it in.

Theming

Components ship with neutral default styling. Customize copy and legal links via props (legalLinks, productName, aiTrainingLabel, etc.).

See also

License

Apache-2.0 © Vagish Kapila / Varshyl Inc.