GoneViral

A wrapper that shows children only when a certain traffic threshold is met.

GoneViral Preview

This preview requires a valid Simple Analytics API key to function correctly. Without it, it will likely fail or show the fallback.

Fallback: Not viral yet (or invalid key)

Installation

bunx --bun shadcn@latest add undefined/r/GoneViral.json

Usage

import { GoneViral } from "@/components/GoneViral";

<GoneViral
  threshold={1000}
  past={24}
  unit="hours"
  provider="simpleanalytics"
  hostname="example.com"
  urls={["/blog/my-viral-post"]}
  apiKey={process.env.SIMPLE_ANALYTICS_API_KEY!}
  fallback={<p>Not viral yet</p>}
>
  <div>Viral Content</div>
</GoneViral>;