# Native Modules

> Skill: Native Module Integration

- Skill: `sawrus/native-modules` (Agent Skill)
- Install (CLI): `npx skillmds@latest add sawrus/native-modules`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sawrus/native-modules/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: sawrus (https://skillmd.com/u/sawrus)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/sawrus/native-modules

---

# Skill: Native Module Integration

## When to load

When integrating device APIs, bridging to native SDKs, or debugging platform-specific behavior.

## When to Use Native Modules

```
Use Native Module:
- Device hardware (camera, accelerometer, NFC, Bluetooth)
- Cryptographic operations (device secure enclave)
- Computation-intensive tasks (image processing, on-device ML)
- Third-party SDKs without JS wrapper

Stay in JS/React Native:
- UI rendering and interactions
- Network requests
- State management
- Business logic not requiring device APIs
```

## Biometric Authentication

```typescript
import ReactNativeBiometrics from 'react-native-biometrics';

export async function authenticateWithBiometrics(): Promise<boolean> {
  const rnBiometrics = new ReactNativeBiometrics({ allowDeviceCredentials: true });
  const { biometryType } = await rnBiometrics.isSensorAvailable();
  if (!biometryType) return authenticateWithPin();

  const { success } = await rnBiometrics.simplePrompt({
    promptMessage: biometryType === 'FaceID' ? 'Confirm with Face ID' : 'Confirm with fingerprint'
  });
  return success;
}
```

