Skip to main content

Choose an SDK

Nexly has SDKs for browser apps, React, Next.js, React Native, native iOS (Swift), Flutter, and Node.js, plus a hosted script tag for sites without a build step. Pick the SDK that matches where the event is created.

SDK options

Use the hosted script tag for static sites, landing pages, or any HTML where you do not use npm or a bundler. One <script> tag covers pageviews, engagement, and custom events. See Install with a script tag.

Use @nexly/web for a plain browser application or any frontend where you control client-side JavaScript directly.

Use @nexly/react-web for React SPAs. It wraps the browser client in a provider and gives components access through hooks.

Use @nexly/next for Next.js App Router apps. The provider is client-side and tracks route changes.

Use @nexly/react-native for React Native and Expo apps. Track screenviews and in-app events from mobile code.

Use the Swift SDK (Nexly via Swift Package Manager) for native iOS apps built with Swift or SwiftUI. See Install on iOS with Swift.

Use the Flutter SDK (nexly on pub.dev) for Flutter apps on iOS and Android. See Install on Flutter.

Use @nexly/node for backend events from Node.js services, API routes, workers, and scripts.

Credentials

Every SDK needs two values from Settings → Installation:

  • App ID identifies the property.
  • Ingest key authorizes event collection.

Do not use a personal API token for SDK collection. Personal API tokens are for read-only API access.

Allowed origins

For browser and web-based apps, add your production domain to Settings → Ingest → Allowed origins before expecting web data in the dashboard. Local development domains should be added only while you are testing.

React Native, Swift (iOS), Flutter, and Node.js use dedicated SDK traffic sources instead of browser origins. Enable Mobile apps or Backend traffic when those runtimes are used — you can turn them on during Create your first property or later in Settings → Ingest. With mobile or backend enabled, you do not need a browser origin to finish setup or to collect events from those SDKs; add a web origin only when browser traffic should be accepted. See Ingest settings for details.

Tracking options and privacy mode

The installation guide lets you choose tracking options before copying snippets or the AI-agent prompt: automatic pageviews, engagement tracking, outbound-link tracking, and privacy mode. The generated code and prompt reflect your choices.

With privacy mode, the SDK never reads or writes device storage for its identifiers; Nexly counts visitors with a daily-rotating server-side fingerprint instead. See Privacy mode for behavior and trade-offs.