v1.0.0

React Native SDK

beta

Use on: Mobile / React Native 0.71+. Key type:certilayer_live_pk_xxx...

This SDK uses your PUBLIC key — safe to embed in mobile apps.
ℹ️
Captures touch and screen-transition behavior in pure JS/TS — no native Android/iOS setup required.

Install

bash
npm install @certilayer/react-native

1. Wrap your app root

This is the one structural change required — React Native has no document-level touch listener, so touch capture happens through this wrapper.

App.tsx
import CertiLayer, { CertiLayerRoot } from '@certilayer/react-native'

CertiLayer.init({ apiKey: 'certilayer_live_pk_xxxx' }) // PUBLIC key

export default function App() {
  return (
    <CertiLayerRoot>
      {/* your NavigationContainer / app tree */}
    </CertiLayerRoot>
  )
}

2. Track screen transitions

Call from your navigation library's state-change callback (React Navigation shown here).

typescript
<NavigationContainer onStateChange={(state) => {
  const route = state?.routes[state.index]
  if (route) CertiLayer.trackScreen(route.name)
}}>

3. Verify server-side

Same pattern as web — get the session ID and verify it from your backend using the Node or Python SDK.

typescript
const sessionId = CertiLayer.getSessionId()
// send sessionId to your backend, verify with @certilayer/node or the Python SDK
⚠️
Known limitation: touch pressure/contact-area data isn't exposed consistently across iOS and Android, so that feature stays at a neutral default. Keyboard capture isn't included in this version.