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

@gatekeeperx/cordova-plugin-devicex

v1.3.1

Published

GatekeeperX Device Intelligence Cordova plugin (Android)

Readme

@gatekeeperx/cordova-plugin-devicex

License

Plugin oficial de Cordova para la integración del SDK GatekeeperX Device Intelligence en aplicaciones Android. Proporciona capacidades avanzadas de fingerprinting, detección de fraude (root, emuladores, hooks) y telemetría de seguridad.


📋 Requisitos

Para integrar este plugin, asegúrate de cumplir con los siguientes requisitos:

  • Cordova Android: Versión 11.0.0 o superior.
  • Java: JDK 11 o 17.
  • Android SDK: API Level 21+ soportado (API 31+ recomendado).
  • GatekeeperX Credentials: Tenant ID y API Key válidos.

🔧 Instalación

Prerequisitos

Asegúrate de tener instalado Node.js y npm en tu máquina. ejecuta este comando para instalar el plugin:

npm i @gatekeeperx/cordova-plugin-devicex

Instalación

Instala el plugin utilizando el CLI de Cordova o Ionic. Esto configurará automáticamente las dependencias nativas en tu proyecto.

# Usando Ionic CLI (Recomendado)
ionic cordova plugin add @gatekeeperx/cordova-plugin-devicex

# Usando Cordova CLI
cordova plugin add @gatekeeperx/cordova-plugin-devicex

Configuración de Plataforma

Asegúrate de tener la plataforma Android configurada correctamente:

cordova platform add android@11

📚 API Reference

El plugin expone el objeto global Devicex una vez que el evento deviceready se ha disparado.

1. Devicex.configure(options)

Inicializa el SDK con las credenciales de tu proyecto. Debe llamarse antes que cualquier otro método.

Parámetros:

  • options (ConfigureOptions):
    • tenant (string, requerido): ID de tu tenant.
    • apiKey (string, requerido): Tu clave de API.
    • environment (string, opcional): 'SANDBOX', o 'PRODUCTION'.
    • organizationId (string, opcional): Identificador de organización.

Ejemplo:

await Devicex.configure({
  tenant: 'mi-tenant',
  apiKey: 'tu-api-key',
  environment: 'PRODUCTION'
});

2. Devicex.sendEvent(name, properties?, headers?)

Envía un evento de telemetría con señales de seguridad adjuntas automáticamente.

Parámetros:

  • name (string, requerido): Nombre del evento (ej: 'login', 'checkout').
  • properties (object, opcional): Metadatos adicionales del evento.
  • headers (object, opcional): Cabeceras HTTP personalizadas.

Ejemplo:

const result = await Devicex.sendEvent('login', { user: 'id_123' });
if (result.ok) {
  console.log('DeviceX ID:', result.deviceXId);
}

3. Devicex.isInitialized()

Verifica si el SDK ha sido configurado correctamente.

Retorna: Promise<boolean>

4. Devicex.getVersion()

Obtiene la versión del SDK nativo subyacente.

Retorna: Promise<string>


🚀 Uso Rápido (Ionic/Angular)

// En app.component.ts
async initializeApp() {
  await this.platform.ready();
  
  if (this.platform.is('cordova')) {
    declare const Devicex: any;
    
    try {
      await Devicex.configure({
        tenant: 'gatekeeperx', // tu tenant
        apiKey: 'YOUR_API_KEY', // tu api key
        environment: 'PRODUCTION' // PRODUCTION o SANDBOX
      });
      console.log('DeviceX Ready');
    } catch (err) {
      console.error('DeviceX Init Error', err);
    }
  }
}


async login() {
    //,,, logica previo a enviar el login

    loading.present();
    try {
        // Enviar evento de login para obtener deviceXId
        const result = await this.deviceX.sendEvent('login', {
            username: this.username,
            method: 'password',
            timestamp: new Date().toISOString(),
            screen: 'login'
        });
        console.log('Evento enviado, deviceXId:', result.deviceXId);


        /** EVALUACION DE RIESGO
         *  Evaluar riesgo con GatekeeperX - debe hacerse back to back, no en el cliente.
         *  debe ser dentro del proceso del login en el backend
         *  si la decision es allow, se puede continuar con el login
         *  si la decision es deny, se debe denegar el acceso
         *  si la decision es unknown, se debe denegar el acceso
         */
       
        //invocar proceso de login en el backend
        const response = await this.http.post(BACKEND_URL, {
            username: this.username,
            password: this.password,
            deviceXId: result.deviceXId
        });
        console.log('Login response:', JSON.stringify(response, null, 2));

        loading.dismiss();


        console.log('Login event result:', JSON.stringify(result, null, 2));

    } catch (error) {
        loading.dismiss();
        console.error('Login event error:', error);
        this.showAlert('Error', 'No se pudo enviar el evento de login', 'error');
    }
}