npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@datadome/react-native-core-datadome

v0.1.0-beta.1

Published

React Native wrapper around the native CoreDataDome SDKs for Android and iOS.

Readme

@datadome/react-native-core-datadome

React Native SDK for DataDome bot protection, built on the native CoreDataDome SDKs for Android and iOS. It prepares your request headers and validates your HTTP responses against DataDome, presenting a challenge to the user when one is required.

Beta. This package is a pre-release. The API may change before 1.0.

Requirements

| Requirement | Version | | --- | --- | | React Native | 0.85 or later | | React | 19 or later | | Architecture | New Architecture (enabled by default since React Native 0.76) | | iOS | 15.0 or later | | Android | minSdk 24 (Android 7.0) or later |

Installation

npm install @datadome/react-native-core-datadome
# or
yarn add @datadome/react-native-core-datadome

iOS

cd ios && pod install

pod install downloads the native DataDome framework, so it needs network access the first time. Set your app's deployment target to iOS 15.0 or higher.

Android

No extra setup. The native DataDome SDK is resolved from Maven Central.

Usage

import { DataDome, ResponseValidationStatus } from '@datadome/react-native-core-datadome';

const dataDome = new DataDome({ clientKey: 'YOUR_CLIENT_KEY' });

async function request(url: string): Promise<Response> {
  // 1. Add the DataDome headers to your own.
  const response = await fetch(url, {
    headers: await dataDome.prepareRequestHeaders({}, url),
  });

  // 2. Convert the response headers to a plain object.
  const headers: { [key: string]: string } = {};
  response.headers.forEach((value, key) => {
    headers[key] = value;
  });

  // 3. Validate the response. The body is read only if DataDome needs it.
  const status = await dataDome.validateResponse(
    { status: response.status, headers, body: () => response.clone().text() },
    url
  );

  switch (status) {
    case ResponseValidationStatus.Allowed:
      return response;
    case ResponseValidationStatus.NeedRetry:
      return request(url); // the challenge was passed, retry the request
    case ResponseValidationStatus.Blocked:
      throw new Error('Blocked by DataDome');
    case ResponseValidationStatus.Error:
      throw new Error('DataDome validation error');
  }
}

Constructing DataDome again with the same configuration reuses the same client, so it is safe to call in a component body. There is nothing to release.

API

new DataDome(config)

  • config.clientKey: string — your DataDome client key.
  • config.domain?: string | null — optional origin URL.

On Android, a malformed domain throws from the constructor.

prepareRequestHeaders(headers, url): Promise<{ [key: string]: string }>

Returns headers with everything DataDome requires for a request to url added, such as the DataDome cookie. Call it for every protected request and send the request with the result. Pass {} when you have no headers of your own.

validateResponse(response, url): Promise<ResponseValidationStatus>

  • response.status: number — HTTP status code.
  • response.headers: { [key: string]: string } — response headers.
  • response.body: () => string | null | Promise<string | null> — returns the response body as text, or null when there is none. Called only when DataDome needs the body. If it throws, validateResponse rejects with that error.
  • url: string — the request URL.

Resolves to a ResponseValidationStatus:

| Member | Meaning | | --- | --- | | Allowed | Proceed normally. | | NeedRetry | A challenge was passed; retry the request. | | Blocked | The user is blocked; do not retry. | | Error | Validation failed. |

getCookie(url): Promise<DataDomeCookie | null>

Returns the stored DataDome cookie ({ name, value }) for url, or null.

Errors

The methods above reject with these codes:

| Code | Platforms | When | | --- | --- | --- | | ERR_INVALID_URL | Android, iOS | url could not be parsed. | | ERR_INVALID_INSTANCE | Android, iOS | The native module was torn down under a live client. | | ERR_DATADOME | Android | A DataDome call failed. |

Platform differences

  • prepareRequestHeaders: when headers has no Cookie key, Android adds one and iOS does not.
  • The domain passed to new DataDome is validated on Android only.

License

MIT