An Expo module to wrap human native SDK for Expo users.
A module implementing our native SDKs for the Expo framework.
The full Documentation and usage examples can be found at our official site.
```
npm install @humansecurity/expo-mobile-sdk
Then add the config plugin to your app.json (or app.config.js) so the Android dependency repository is automatically configured:
``
{
"expo": {
"plugins": [
"@humansecurity/expo-mobile-sdk"
]
}
}
Note:
The config plugin is available starting from version 1.0.8 and later.
If you are using an earlier version (1.0.2–1.0.6), do not add the plugin line — simply run:
``
npm install @humansecurity/expo-mobile-sdk
npx expo prebuild
Finally, run the prebuild command:
``
npx expo prebuild
`
import { HumanSecurity } from '@humansecurity/expo-mobile-sdk';
//Display the version text in a tag to confirm integration:
`
`
sdkVersion(): string;
startWithAppId(appId: string, policy?: HSPolicy): Promise
startWithAppIds(appIds: string[], policy?: HSPolicy): Promise
vid(appId: string): string | null;
// BD functionality
headersForURLRequest(appId?: string): { [key: string]: string };
handleResponse(response: string, code: number, url: string): Promise
canHandleResponse(response: string, code: number, url: string): boolean;
challengeReferenceId(): string;
setCustomParameters(parameters: { [key: string]: string }, appId?: string): void;
// Adding AD functions
setUserId(userId: string | null, appId?: string): void;
registerOutgoingUrlRequest(url: string, appId?: string): void;
setAdditionalData(parameters: { [key: string]: string }, appId?: string): void;
`
For the react-native bare workflow projects see our integration guide.
If your project does not use expo prebuild, you must manually add the repository entry to your android/build.gradle file.
Make sure this block appears in every section where you define repositories:
```
allprojects {
repositories {
// ... your existing repos
maven { url 'https://jfrog.humansecurity.com/artifactory/human-android-sdk/' }
}
}
The config plugin automatically adds this during expo prebuild,
but in custom workflows, it must be added manually to ensure proper Android dependency resolution.