sprintcheck-expo
v1.0.5
Published
SprintCheck SDK for Expo - Identity verification (BVN, NIN, Facial) for React Native Expo projects
Maintainers
Readme
SprintCheck SDK for Expo
A React Native Expo SDK for identity verification services including BVN (Bank Verification Number), NIN (National Identification Number), and Facial verification.
Features
- 🏦 BVN Verification - Verify Bank Verification Numbers
- 🆔 NIN Verification - Verify National Identification Numbers
- 👤 Facial Verification - Biometric facial verification
- 📱 Expo Compatible - Works with Expo managed and bare workflows
- 🔒 Secure - End-to-end encryption for sensitive data
- 🚀 Easy Integration - Simple API with TypeScript support
Installation
npm install sprintcheck-expoor
yarn add sprintcheck-expoConfiguration
1. Prebuild your project
Since this SDK uses native modules, you need to generate the native code:
expo prebuild2. Add this to your MainApplication.kt
import com.sprintcheckrn.SprintCheckPackage
packages.add(SprintCheckPackage())3. Run your project
expo run:androidNote: Currently only Android is supported. iOS support coming soon.
Usage
Basic Setup
import SprintCheck from 'sprintcheck-expo';
// Initialize the SDK
const initializeSDK = async () => {
const result = await SprintCheck.initialize({
apiKey: 'your-api-key',
encryptionKey: 'your-encryption-key'
});
if (result.success) {
console.log('SDK initialized successfully');
} else {
console.error('Failed to initialize SDK:', result.error);
}
};BVN Verification
const verifyBVN = async (email: string) => {
try {
const result = await SprintCheck.startBvnVerification(email);
if (result.success) {
console.log('BVN verification started:', result.data);
} else {
console.error('BVN verification failed:', result.error);
}
} catch (error) {
console.error('Error:', error);
}
};NIN Verification
const verifyNIN = async (email: string) => {
try {
const result = await SprintCheck.startNinVerification(email);
if (result.success) {
console.log('NIN verification started:', result.data);
} else {
console.error('NIN verification failed:', result.error);
}
} catch (error) {
console.error('Error:', error);
}
};Facial Verification
const verifyFace = async (email: string) => {
try {
const result = await SprintCheck.startFacialVerification(email);
if (result.success) {
console.log('Facial verification started:', result.data);
} else {
console.error('Facial verification failed:', result.error);
}
} catch (error) {
console.error('Error:', error);
}
};API Reference
initialize(config: SprintCheckConfig): Promise<VerificationResult>
Initializes the SprintCheck SDK with your API credentials.
Parameters:
config.apiKey(string): Your SprintCheck API keyconfig.encryptionKey(string): Your encryption key
Returns: Promise resolving to a VerificationResult
startBvnVerification(email: string): Promise<VerificationResult>
Starts the BVN verification process.
Parameters:
email(string): User's email address
Returns: Promise resolving to a VerificationResult
startNinVerification(email: string): Promise<VerificationResult>
Starts the NIN verification process.
Parameters:
email(string): User's email address
Returns: Promise resolving to a VerificationResult
startFacialVerification(email: string): Promise<VerificationResult>
Starts the facial verification process.
Parameters:
email(string): User's email address
Returns: Promise resolving to a VerificationResult
getInitializationStatus(): boolean
Returns the current initialization status of the SDK.
Types
interface SprintCheckConfig {
apiKey: string;
encryptionKey: string;
}
interface VerificationResult {
success: boolean;
message: string;
data?: any;
error?: string;
}Requirements
- Expo SDK 49+
- React Native 0.70+
- Android API level 24+
- Node.js 16+
Troubleshooting
Common Issues
"SprintCheck doesn't seem to be linked" error
- Make sure you've run
expo prebuild - Ensure the plugin is properly configured in your app.json
- Try cleaning and rebuilding:
expo prebuild --clean
- Make sure you've run
Build errors on Android
- Ensure your Android SDK is up to date
- Check that minSdkVersion is at least 24
- Try running
cd android && ./gradlew clean
Plugin not found
- Make sure you've installed the package correctly
- Verify the plugin path in your app.json configuration
Getting Help
If you encounter issues:
- Contact support at [email protected]
License
MIT License - see LICENSE file for details.
Support
- 📧 Email: [email protected]
- 📖 Documentation: Click here
