Documentation
Docs API Reference SDKs Guides Changelog Status
v4.1
Log in Dashboard →

SDKs

Official Prynt SDKs for every major platform. Client SDKs collect device signals and identify visitors. Server SDKs verify identifications, query events, and manage rules.

Overview

Prynt provides first-party SDKs for 12 platforms, covering browser, mobile, and server environments. All SDKs follow the same identify on the client, verify on the server pattern.

Supported platforms

SDKPackageTypeLatest version
JavaScript@prynt/sdkClient3.8.2
React@prynt/reactClient2.5.0
iOS (Swift)PryntSDKClient4.1.0
Android (Kotlin)com.prynt:prynt-androidClient3.2.1
Flutterprynt_flutterClient1.4.0
React Native@prynt/react-nativeClient2.1.3
Node.js@prynt/nodeServer5.0.1
Pythonprynt-sdkServer3.3.0
Goprynt-goServer1.6.2
Javacom.prynt:prynt-javaServer2.4.0
RubypryntServer1.2.1
.NETPrynt.SDKServer0.9.0-beta

Versioning policy

All Prynt SDKs follow semantic versioning (semver). Major versions indicate breaking changes, minor versions add features, and patch versions fix bugs. We support the current and previous major version with security patches. Deprecated versions receive 12 months of security-only updates after a new major release.

📋
Need help choosing? For web apps, start with the JavaScript SDK. For React apps, use the React SDK which wraps the core client in hooks and providers. For server-side verification, pick the SDK matching your backend language.

JavaScript SDK

The core client SDK for browser environments. Collects device signals and returns a persistent visitorId. Lightweight (~12KB gzipped) with zero dependencies.

Installation

Terminal
# npm
npm install @prynt/sdk

# yarn
yarn add @prynt/sdk

# CDN (no build step)
<script src="https://cdn.prynt.io/v3/agent.js"></script>

Quick start

app.js
import { Prynt } from '@prynt/sdk';

const prynt = new Prynt({
  apiKey: 'pk_live_xxxxxxxxxxxx',
  region: 'us',
});

// Identify the current visitor
const result = await prynt.identify();
console.log(result.visitorId);  // "pv_8kX2mNqR3jT7p"
console.log(result.requestId);  // "req_1707832921_a7f2c9"

Configuration options

ParameterTypeDescription
apiKeyRequiredstringYour public API key (pk_live_...). Safe to include in client code.
regionstringData residency region.Default: "us" · Options: "us" "eu" "ap"
endpointstringCustom subdomain proxy for ad-blocker bypass.Default: null
timeoutnumberRequest timeout in milliseconds.Default: 10000
debugbooleanEnable verbose console logging for development.Default: false
disableCookiesbooleanDisable first-party cookie storage. Reduces accuracy slightly.Default: false

Methods

MethodReturnsDescription
identify(options?)Promise<Result>Collects device signals and returns visitorId, requestId, and confidence. Call on key user actions (login, checkout, signup).
evaluate(tag?)Promise<Evaluation>Runs identification plus server-side rules evaluation. Returns verdict (allow, challenge, block) from the Rules Engine.
getVisitor()Promise<Visitor>Retrieves the cached visitor profile without making a new identification request. Returns null if no prior identification.

Browser support

BrowserMin versionNotes
Chrome60+Full support including Chromium-based browsers (Edge, Brave, Opera)
Firefox55+Full support
Safari12+Full support. ITP-resistant identification via first-party cookies.
Edge79+Chromium-based Edge. Legacy Edge (EdgeHTML) not supported.
Mobile browsersvariesChrome Mobile, Safari iOS 12+, Samsung Internet 8.2+, Firefox Mobile 55+
💡
CDN usage: When loaded via CDN, the SDK attaches to window.Prynt automatically. Use new window.Prynt({...}) instead of importing.

React SDK

React bindings for the Prynt client SDK. Provides a context provider and hooks for seamless integration with React applications.

Installation

Terminal
npm install @prynt/react

PryntProvider setup

App.tsx
import { PryntProvider } from '@prynt/react';

function App() {
  return (
    <PryntProvider
      apiKey="pk_live_xxxxxxxxxxxx"
      region="us"
    >
      <YourApp />
    </PryntProvider>
  );
}

usePrynt() hook

LoginForm.tsx
import { usePrynt } from '@prynt/react';

function LoginForm() {
  const { identify, isReady, error } = usePrynt();

  const handleLogin = async () => {
    const { visitorId, requestId } = await identify();

    // Send requestId to your server for verification
    await fetch('/api/login', {
      method: 'POST',
      body: JSON.stringify({
        email, password, requestId,
      }),
    });
  };

  return (
    <button
      onClick={handleLogin}
      disabled={!isReady}
    >
      Log in
    </button>
  );
}
📋
SSR compatible: The React SDK safely no-ops during server rendering. Identification only runs in the browser. Works with Next.js, Remix, and Gatsby.

iOS SDK (Swift)

Native iOS SDK for device identification on iPhone and iPad. Collects 56+ mobile-specific signals including hardware identifiers, motion sensors, and accessibility settings.

Requirements

RequirementVersion
iOS13.0+
Swift5.5+
Xcode14.0+

Installation

Swift Package Manager
// In Xcode: File → Add Package Dependencies
// Enter the repository URL:
https://github.com/prynt-io/prynt-ios-sdk
Podfile (CocoaPods)
pod 'PryntSDK', '~> 4.1'

Quick start

AppDelegate.swift
import PryntSDK

// Configure on app launch
let prynt = Prynt(
  apiKey: "pk_live_xxxxxxxxxxxx",
  region: .us
)

// Identify the device
let result = try await prynt.identify()
print(result.visitorId)   // "pv_mB3nKq9xRt2Wp"
print(result.requestId)   // "req_1707832921_c4d8e1"
print(result.confidence)  // 0.998

Configuration

ParameterTypeDescription
apiKeyRequiredStringYour public API key.
regionRegionData residency region: .us, .eu, .apDefault: .us
timeoutTimeIntervalRequest timeout in seconds.Default: 10.0
extendedSignalsBoolCollect additional hardware signals (GPU, motion, accessibility). Increases accuracy.Default: true

Android SDK (Kotlin)

Native Android SDK for device identification. Supports phones, tablets, and Android TV. Collects 60+ hardware and software signals.

Requirements

RequirementVersion
Android API21+ (Lollipop)
Kotlin1.6+
Android Gradle Plugin7.0+

Installation

build.gradle.kts
// Add to your app-level build.gradle.kts
dependencies {
  implementation("com.prynt:prynt-android:3.2.1")
}

Quick start

MainActivity.kt
import com.prynt.sdk.Prynt
import com.prynt.sdk.PryntConfig

// Initialize in Application.onCreate()
val config = PryntConfig.Builder("pk_live_xxxxxxxxxxxx")
  .region(Region.US)
  .build()

val prynt = Prynt.init(context, config)

// Identify the device
lifecycleScope.launch {
  val result = prynt.identify()
  Log.d("Prynt", "Visitor: ${result.visitorId}")
  Log.d("Prynt", "Request: ${result.requestId}")
}
⚠️
ProGuard/R8: The SDK includes its own ProGuard rules. No additional configuration needed if you use consumerProguardFiles (default for Android libraries).

Flutter SDK

Cross-platform Flutter plugin for device identification on iOS and Android from a single codebase. Wraps native SDKs for maximum signal accuracy.

Installation

pubspec.yaml
dependencies:
  prynt_flutter: ^1.4.0
Terminal
flutter pub get

Quick start

main.dart
import 'package:prynt_flutter/prynt_flutter.dart';

// Initialize the SDK
final prynt = Prynt(
  apiKey: 'pk_live_xxxxxxxxxxxx',
  region: Region.us,
);

// Identify the device
final result = await prynt.identify();
print('Visitor: ${result.visitorId}');
print('Request: ${result.requestId}');

Platform-specific setup

📋
iOS: Requires iOS 13+. Add NSAppTransportSecurity exception if using a custom endpoint. No additional pod install needed — the plugin handles native dependencies automatically.

Android: Requires API 21+. Add com.prynt:prynt-android to your app's build.gradle if using custom native modules alongside the Flutter plugin.

React Native SDK

React Native module with native bridges for iOS and Android. Uses the same hooks API as the React SDK for a familiar developer experience.

Installation

Terminal
npm install @prynt/react-native

# iOS: install native pods
cd ios && pod install

Quick start

App.tsx
import { PryntProvider, usePrynt } from '@prynt/react-native';

function App() {
  return (
    <PryntProvider apiKey="pk_live_xxxxxxxxxxxx">
      <HomeScreen />
    </PryntProvider>
  );
}

function HomeScreen() {
  const { identify } = usePrynt();

  const handlePress = async () => {
    const { visitorId, requestId } = await identify();
    console.log(visitorId, requestId);
  };

  return <Button onPress={handlePress} title="Identify" />;
}

Linking native modules

💡
Auto-linking: React Native 0.60+ auto-links native modules. For older versions, run react-native link @prynt/react-native. On iOS, run pod install after linking. On Android, rebuild with ./gradlew assembleDebug.

Node.js Server SDK

Server-side SDK for Node.js. Verify identifications, query visitor history, and evaluate rules. Supports Node.js 16+ with full TypeScript definitions.

Installation

Terminal
npm install @prynt/node

Server-side verification

server.js
import { PryntServer } from '@prynt/node';

const prynt = new PryntServer({
  secretKey: process.env.PRYNT_SECRET_KEY,
});

// Verify an identification event
const event = await prynt.events.get('req_1707832921_a7f2c9');
console.log(event.visitorId);     // "pv_8kX2mNqR3jT7p"
console.log(event.confidence);    // 0.995
console.log(event.signals.bot);   // { detected: false }

// Get visitor history
const visitor = await prynt.visitors.get('pv_8kX2mNqR3jT7p');
console.log(visitor.totalEvents);  // 142

// Evaluate rules for a request
const eval = await prynt.evaluate('req_1707832921_a7f2c9');
console.log(eval.verdict);  // "allow"

Available methods

MethodReturnsDescription
events.get(requestId)Promise<Event>Retrieve a verified identification event by request ID.
events.list(filters?)Promise<EventList>List events with optional filtering by visitor, date range, or signals.
visitors.get(visitorId)Promise<Visitor>Retrieve visitor profile with history and aggregated risk scores.
visitors.getEvents(id)Promise<EventList>List all identification events for a specific visitor.
evaluate(requestId)Promise<Evaluation>Run rules evaluation and return verdict for a given identification.
⚠️
Secret key security: Never expose your sk_live_... key in client-side code or version control. Use environment variables or a secrets manager. Rotate keys immediately if compromised via Settings → API Keys.

Python Server SDK

Python SDK for server-side verification and API access. Supports Python 3.8+ with both sync and async clients. Full type annotations included.

Installation

Terminal
pip install prynt-sdk

Quick start

app.py
import os
from prynt import PryntClient

client = PryntClient(
    secret_key=os.environ["PRYNT_SECRET_KEY"]
)

# Verify an identification
event = client.events.get("req_1707832921_a7f2c9")
print(event.visitor_id)    # "pv_8kX2mNqR3jT7p"
print(event.confidence)    # 0.995
print(event.signals.bot)   # BotSignal(detected=False)

# Get visitor history
visitor = client.visitors.get("pv_8kX2mNqR3jT7p")
print(visitor.total_events)  # 142

# Async usage
from prynt import AsyncPryntClient

async_client = AsyncPryntClient(
    secret_key=os.environ["PRYNT_SECRET_KEY"]
)
event = await async_client.events.get("req_...")

Go Server SDK

Go SDK for server-side verification. Idiomatic Go with context support, structured errors, and zero external dependencies.

Installation

Terminal
go get github.com/prynt-io/prynt-go

Quick start

main.go
package main

import (
    "context"
    "fmt"
    "os"

    "github.com/prynt-io/prynt-go"
)

func main() {
    client := prynt.NewClient(
        os.Getenv("PRYNT_SECRET_KEY"),
    )

    // Verify an identification
    event, err := client.Events.Get(
        context.Background(),
        "req_1707832921_a7f2c9",
    )
    if err != nil {
        panic(err)
    }

    fmt.Println(event.VisitorID)   // "pv_8kX2mNqR3jT7p"
    fmt.Println(event.Confidence)  // 0.995
    fmt.Println(event.Signals.Bot) // {Detected: false}
}

Java Server SDK

Java SDK for server-side verification. Supports Java 11+ with both synchronous and reactive (Project Reactor) clients. Works with Spring Boot, Quarkus, and Micronaut.

Installation

pom.xml (Maven)
<dependency>
  <groupId>com.prynt</groupId>
  <artifactId>prynt-java</artifactId>
  <version>2.4.0</version>
</dependency>
build.gradle (Gradle)
implementation 'com.prynt:prynt-java:2.4.0'

Quick start

VerifyService.java
import com.prynt.sdk.PryntClient;
import com.prynt.sdk.model.Event;

public class VerifyService {

  private final PryntClient client;

  public VerifyService() {
    this.client = PryntClient.builder()
      .secretKey(System.getenv("PRYNT_SECRET_KEY"))
      .build();
  }

  public Event verify(String requestId) {
    Event event = client.events().get(requestId);

    System.out.println(event.getVisitorId());
    System.out.println(event.getConfidence());

    return event;
  }
}

Ruby Server SDK

Ruby SDK for server-side verification. Supports Ruby 3.0+ with a clean, idiomatic API. Works with Rails, Sinatra, and any Rack-based framework.

Installation

Terminal
gem install prynt

# Or add to your Gemfile
gem 'prynt', '~> 1.2'

Quick start

verify_controller.rb
require 'prynt'

client = Prynt::Client.new(
  secret_key: ENV['PRYNT_SECRET_KEY']
)

# Verify an identification
event = client.events.get('req_1707832921_a7f2c9')
puts event.visitor_id    # "pv_8kX2mNqR3jT7p"
puts event.confidence    # 0.995
puts event.signals.bot   # #<BotSignal detected=false>

# Get visitor history
visitor = client.visitors.get('pv_8kX2mNqR3jT7p')
puts visitor.total_events  # 142

.NET Server SDK Beta

The .NET SDK for server-side verification. Supports .NET 6+ with full async/await support, dependency injection, and strongly-typed models. Currently in public beta.

⚠️
Beta software: The .NET SDK is in public beta. The API surface may change between minor versions. Pin to an exact version in production. Report issues on GitHub.

Installation

Terminal (NuGet)
dotnet add package Prynt.SDK --version 0.9.0-beta

# Or via Package Manager Console
Install-Package Prynt.SDK -Version 0.9.0-beta

Quick start

VerifyController.cs
using Prynt.SDK;

// Register in DI (Startup.cs / Program.cs)
builder.Services.AddPrynt(options =>
{
    options.SecretKey = builder.Configuration["Prynt:SecretKey"];
});

// Inject and use in a controller
public class VerifyController : ControllerBase
{
    private readonly IPryntClient _prynt;

    public VerifyController(IPryntClient prynt)
    {
        _prynt = prynt;
    }

    [HttpPost("api/verify")]
    public async Task<IActionResult> Verify(
        [FromBody] VerifyRequest request)
    {
        var ev = await _prynt.Events
            .GetAsync(request.RequestId);

        if (ev.Signals.Bot.Detected)
            return Forbid();

        return Ok(new { ev.VisitorId });
    }
}
💡
Dependency injection: The AddPrynt() extension registers IPryntClient as a singleton with automatic HttpClient management via IHttpClientFactory. Works seamlessly with ASP.NET Core, Azure Functions, and Worker Services.