@nexushub/client
v1.1.13
Published
GN-Apex zero-config production runtime SDK
Readme
GN-Apex SDK 1.1.0
The GN-Apex SDK is the runtime layer for GN-Apex-generated sites. It is deliberately zero developer configuration: site developers focus on content, components and UI/UX while GN-Apex owns platform behavior.
Zero-config by design
import { nexus } from "@nexushub/client";
const page = await nexus.getPage("home");A GN-Apex deployment can inject runtime configuration through window.__GNAPEX__ or meta tags. Environment variables remain supported as an escape hatch for Node/CI.
Automatic runtime behavior
By default the browser runtime automatically handles:
- page views and SPA navigation
- clicks, links, buttons, outbound links
- dead/rage clicks
- forms without collecting field values
- video lifecycle + 25/50/75/90/100% milestones
- scroll depth
- Web Vitals
- uncaught errors and unhandled rejections
- session/visitor identity
- offline IndexedDB event queue
- retry, batching, deduplication IDs and circuit breaking
- authentication synchronization
- push subscription synchronization (permission prompting remains platform/UX controlled)
- realtime content updates and cache invalidation
Custom analytics calls are available as an escape hatch, not a requirement.
Cache model
GN-Apex intentionally defaults content revalidation to false. This is not a short-lived SDK cache. GN-Apex/Cloudflare owns invalidation and purge. Content can therefore be cached effectively forever until the platform purges affected resources.
The SDK still supports per-call revalidation for exceptional integrations, but production GN-Apex sites should normally leave the platform default untouched.
Reliability
The internal request pipeline provides request IDs, normalized errors, timeout handling, retry/backoff with jitter, rate limiting and circuit breaking. The request coalescer prevents duplicate concurrent reads for the same resource without incorrectly resolving unrelated requests with the same response.
Platform features
The runtime exposes feature flags, remote configuration, diagnostics and a typed event bus for internal/platform integrations.
Security
Never expose a privileged server secret in browser configuration. Browser deployments should use the public GN-Apex credential model enforced by the platform. Analytics payloads redact common credential/secret fields when privacy redaction is enabled.
Build
npm install
npm run type-check
npm test
npm run buildBefore publishing, run the complete test/build pipeline in the target CI environment.
