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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@conectahub/sdk-connecthub-kyc-rn

v1.3.3

Published

SDK ConectaHub KYC React Native

Downloads

83

Readme

🚀 ConnectaHub KYC

Biblioteca React Native para integração com o ConnectaHub KYC, permitindo a verificação de identidade via WebView.

📥 Instalação

Antes de instalar, certifique-se de que seu projeto React Native já está configurado.

🔹 Instalar a biblioteca

Se estiver usando npm:


npm install @conectahub/sdk-connecthub-kyc-rn 

Se estiver usando yarn:

yarn add connectahub-kyc
🛠 Configuração
Certifique-se de que o react-native-webview está instalado:

A biblioteca depende do react-native-webview. Caso ainda não tenha instalado, execute:

npm install react-native-webview

Ou com Yarn:

yarn add react-native-webview
Configurar permissão para WebView (Android):

📌Configuração para Android

Abra o arquivo android/app/src/main/AndroidManifest.xml e adicione as seguintes permissões dentro da tag <manifest>:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>

Para garantir o funcionamento correto da câmera no Android, adicione a seguinte configuração dentro da tag 
<application>:

 
<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:grantUriPermissions="true"
    android:exported="false">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/provider_paths"/>
</provider>
Agora, crie o arquivo android/app/src/main/res/xml/provider_paths.xml e adicione:

 
<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-files-path name="camera_images" path="Pictures"/>
</paths>
📌 Configuração para iOS
No arquivo ios/Info.plist, adicione:

 
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

<key>NSCameraUsageDescription</key>
<string>Este aplicativo precisa acessar a câmera para capturar fotos e realizar a verificação de identidade.</string>

<key>NSMicrophoneUsageDescription</key>
<string>Este aplicativo precisa acessar o microfone para capturar vídeos durante a verificação.</string>
Isso garantirá que o aplicativo tenha permissão para acessar a câmera e o microfone no iOS.


📌 Como Usar
Aqui está um exemplo de implementação completa no seu aplicativo React Native:

import React, { useState } from "react";
import { View, StyleSheet, Text, Button, Alert, ActivityIndicator } from "react-native";
import { ConnectaHubKYC, Transaction } from "connectahub-kyc";

export default function App() {
  const [isProcessing, setIsProcessing] = useState(false);
  
  // Token de autenticação obtido do backend
  const authToken = "SEU_TOKEN_AQUI";

  // Dados da transação para o KYC
  const transactionData: Transaction = {
    name: "João Silva",
    document_number: "123.456.789-00",
    birthdate: "1990-01-01",
    email: "[email protected]",
    country_code: "BR",
    phone: "5592999999999"
  };

  // Componente de carregamento personalizado
  const CustomLoadingComponent = () => (
    <View style={styles.loadingContainer}>
      <ActivityIndicator size="large" color="#0000ff" />
      <Text style={styles.loadingText}>Preparando verificação de identidade...</Text>
      <Text style={styles.loadingSubtext}>Por favor, aguarde alguns instantes</Text>
    </View>
  );

  return (
    <View style={styles.container}>
      {!isProcessing ? (
        <View style={styles.buttonContainer}>
          <Text style={styles.title}>Verificação KYC</Text>
          <Text style={styles.description}>
            Prepare seu documento de identidade e inicie o processo de verificação.
          </Text>
          <Button title="Iniciar verificação" onPress={() => setIsProcessing(true)} />
        </View>
      ) : (
        <ConnectaHubKYC
          transaction={transactionData}
          token={authToken} // Passando o token de autenticação
          customLoadingComponent={CustomLoadingComponent}
          onTransactionCreated={(id, url) => {
            console.log(`Transação criada: ${id}`);
            console.log(`URL do iframe: ${url}`);
          }}
          onError={(error) => {
            Alert.alert("Erro", error.message, [{ text: "OK", onPress: () => setIsProcessing(false) }]);
          }}
        />
      )}
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "white"
  },
  buttonContainer: {
    flex: 1,
    justifyContent: "center",
    padding: 20
  },
  title: {
    fontSize: 24,
    fontWeight: "bold",
    textAlign: "center",
    marginBottom: 16
  },
  description: {
    fontSize: 16,
    textAlign: "center",
    marginBottom: 32
  },
  loadingContainer: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "#f5f5f5",
    padding: 20
  },
  loadingText: {
    fontSize: 18,
    marginTop: 16,
    textAlign: "center",
    fontWeight: "bold"
  },
  loadingSubtext: {
    fontSize: 14,
    marginTop: 8,
    color: "#666",
    textAlign: "center"
  }
});