@foglift/sensor
v0.1.0
Published
Install the Foglift Sensor in a code-built site with one command.
Maintainers
Readme
Foglift Sensor CLI
Install the Foglift Sensor in a code-built site with the publishable workspace identifier from Foglift AI Traffic (it is a capability identifier, not a secret API key):
npx @foglift/sensor@latest init --token PUBLIC_WORKSPACE_IDThe CLI detects Next.js or Cloudflare Workers, installs the stable
@foglift/tracker runtime, and composes around the existing request boundary or
Worker code. For Next.js 16 it preserves and exports proxy; for older Next.js
projects it keeps the middleware convention. Root/src placement and static
custom pageExtensions are respected. The original source is preserved
byte-for-byte in a neighboring *.foglift-original.* file and is never replaced
on a later run.
The tracker sends the request hostname with the workspace capability. Foglift
accepts an event only when both identify the same workspace; a hostname alone
cannot write analytics. If the URL cannot be inferred from package metadata, pass
--url https://example.com.
Equivalent one-shot commands:
pnpm dlx @foglift/sensor@latest init --token PUBLIC_WORKSPACE_ID
yarn dlx @foglift/sensor@latest init --token PUBLIC_WORKSPACE_IDAfter deploying the patched site, verify a recognized crawler request in Foglift AI Traffic.
