Add 4 packages to family — oriz-rate-limit, oriz-analytics, oriz-seo, oriz-consent (22 packages total)
4 new packages ? 22 total
New packages
1. @chirag127/oriz-rate-limit
Purpose: Per-user, per-app usage caps enforcing Free / Pro / Max tier limits (10/100/unlimited PDF merges, image conversions, AI completions, etc.).
Surface:
import { rateLimit } from '@chirag127/oriz-rate-limit';
const result = await rateLimit.check({
userId,
action: 'pdf.merge',
tier: 'free', // from Firestore subscription
});
if (!result.allowed) throw new RateLimitError(result.resetAt);
Storage: Firestore users/{uid}/usage/{action-YYYY-MM-DD} doc counters. Daily reset.
Tier defaults:
const limits = {
free: { 'pdf.merge': 10, 'image.convert': 10, 'ai.complete': 10 },
pro: { 'pdf.merge': 100, 'image.convert': 100, 'ai.complete': 50 },
max: { 'pdf.merge': Infinity, 'image.convert': Infinity, 'ai.complete': Infinity },
};
2. @chirag127/oriz-analytics
Purpose: Single wrapper around Cloudflare Web Analytics + GA4 + Microsoft Clarity + Sentry. One init call per app.
Surface:
import { analytics } from '@chirag127/oriz-analytics';
analytics.init({
app: 'oriz-paisa-finance-tools-app',
ga4: process.env.PUBLIC_GA4_MEASUREMENT_ID,
clarity: process.env.PUBLIC_CLARITY_PROJECT_ID,
cfBeacon: process.env.PUBLIC_CF_BEACON_TOKEN,
sentryDsn: process.env.PUBLIC_SENTRY_DSN,
});
analytics.track('pdf.merge', { pages: 5 });
Klaro consent gating built in (per consent rule).
3. @chirag127/oriz-seo
Purpose: Sitemap + IndexNow auto-submission + JSON-LD per page-type + OG image generator (satori).
Surface:
---
import { SEO } from '@chirag127/oriz-seo';
---
<SEO
title="My PDF Slicer"
description="..."
type="WebApplication"
ogImage={generated}
/>
Build-time: writes per-app sitemap.xml; family-wide sitemap-index.xml aggregates.
4. @chirag127/oriz-consent
Purpose: Klaro consent manager pre-configured for EU/UK (default-DENIED), India DPDP (banner with India copy), US GPC honor, ROW (no banner). Geo-routed via CF.
Surface:
---
import { ConsentBanner } from '@chirag127/oriz-consent';
---
<ConsentBanner services={[...]} />
5-category Klaro config baked in (per existing decision).
Updated count
Total packages: 22 (was 18 ? +4)
| Old 18 | + New 4 |
|---|---|
| astro-shell, astro-chrome, astro-tools, astro-content, astro-data, astro-forms, astro-billing, astro-pwa, astro-distribute, astro-widgets, astro-test-utils, auth-core, auth-wxt, auth-vsc, auth-cli, omni-publish, oriz-book-build, oriz-ai-providers | oriz-rate-limit, oriz-analytics, oriz-seo, oriz-consent |
Migration plan
For each new package:
gh repo create chirag127/<slug>-npm-pkg --public --license MIT --description "..."- Scaffold per
oriz-app-templatefor packages (or hand-scaffold) - Initial v0.1.0 stub publish to npm (reserve the slug)
- Add as submodule under
repos/oriz/own/lib/npm/ - Real implementation in v0.2.0 once consumed by a real app
Cross-refs
- Now
the-22-packages.md(rename fromthe-23-packages.mdafter migration completes) - Three-tier pricing (rate-limit enforces tiers) ? [[monetisation/pricing/three-tier-free-pro-max]]
- SEO decision ? [[decisions/ops/seo-a11y-cdn-ssl]]
- Consent management ? [[security/consent-management-multi-category]]
- Family inventory ? [[services/family-inventory]]