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

@jskit-ai/google-rewarded-core

v0.1.5

Published

Server runtime for Google rewarded unlock gates.

Readme

@jskit-ai/google-rewarded-core

Server runtime for Google rewarded unlock gates.

Package Shape

This package installs:

  • four CRUD-owned server providers, one per persisted table
  • one workflow provider for the rewarded gate API

The persisted tables are:

  • google_rewarded_rules
  • google_rewarded_provider_configs
  • google_rewarded_watch_sessions
  • google_rewarded_unlock_receipts

The package keeps the CRUD ownership strict:

  • rules and provider configs are workspace-owned
  • watch sessions and unlock receipts are workspace_user-owned

Every owned row carries direct owner columns. The module does not rely on inherited ownership through parent joins.

What It Does

The workflow provider exposes four workspace-scoped app routes:

  • GET /api/w/:workspaceSlug/google-rewarded/current
  • POST /api/w/:workspaceSlug/google-rewarded/start
  • POST /api/w/:workspaceSlug/google-rewarded/grant
  • POST /api/w/:workspaceSlug/google-rewarded/close

These are plain workflow endpoints, not CRUD JSON:API endpoints.

The flow is:

  1. current decides whether the gate is enabled, blocked, or already unlocked.
  2. start creates a watch session when a reward is required.
  3. grant marks the session rewarded and creates an unlock receipt.
  4. close closes a started session without granting access.

Day 0 is intentionally app-surface-only for the rewarded workflow. Rules and provider configs should therefore use surface = "app" for the active gate rows.

Required Data

Day-0 configuration lives in the CRUD-owned tables.

At minimum, apps need:

  • a google_rewarded_rules row for the target gateKey
  • a matching enabled google_rewarded_provider_configs row for the surface

Important config fields:

  • google_rewarded_rules.gate_key
  • google_rewarded_rules.surface
  • google_rewarded_rules.unlock_minutes
  • google_rewarded_rules.cooldown_minutes
  • google_rewarded_rules.daily_limit
  • google_rewarded_provider_configs.surface
  • google_rewarded_provider_configs.ad_unit_path
  • google_rewarded_provider_configs.script_mode

Day 0 assumes GPT rewarded ads for web, so script_mode should stay aligned with that flow.

Protecting Server Features

Protected server mutations should use the exported helper:

import { requireGoogleRewardedUnlock } from "@jskit-ai/google-rewarded-core/server/requireGoogleRewardedUnlock";

The dedicated manual page is:

That page shows the exact service and provider wiring pattern.

Policy Model

This module is designed for rewarded unlocks, not for blocking all normal app use on boot.

Recommended usage:

  • unlock bonus actions
  • unlock extra quota
  • unlock a temporary feature window

Do not treat it as a hard requirement for baseline product use unless the ad provider policy clearly allows that.

Install Notes

When an app adds this package, JSKIT installs the four schema migrations from templates/migrations/.

The package does not add day-0 settings pages automatically. Configuration can stay manual or be layered with app-specific UI later.