@harkenapp/sdk-react-native
v0.1.2
Published
Harken React Native / Expo SDK for in-app feedback
Maintainers
Readme
Harken React Native SDK
React Native / Expo SDK for submitting in-app feedback.
Installation
npx expo install @harkenapp/sdk-react-nativePermissions
The SDK requires camera and photo library permissions to support attachment features. The SDK includes an Expo config plugin that automatically configures these permissions.
Automatic Configuration (Recommended)
Add the SDK to your app.json or app.config.js plugins:
{
"expo": {
"plugins": ["@harkenapp/sdk-react-native"]
}
}This automatically configures:
iOS (Info.plist):
NSCameraUsageDescription- Camera access for taking photosNSPhotoLibraryUsageDescription- Photo library access for selecting images
Note:
NSDocumentsFolderUsageDescriptionis not required. The SDK usesexpo-document-pickerwhich presents the system document picker UI, handling file access permissions automatically without needing an Info.plist entry.
Android (AndroidManifest.xml):
android.permission.CAMERA- Camera accessandroid.permission.READ_MEDIA_IMAGES- Photo library access (Android 13+)android.permission.READ_EXTERNAL_STORAGE- Photo library access (Android 12 and below)
Custom Permission Strings
You can customize the iOS permission dialog strings:
{
"expo": {
"plugins": [
[
"@harkenapp/sdk-react-native",
{
"cameraPermission": "Take photos to include with your feedback",
"photoLibraryPermission": "Select photos to include with your feedback"
}
]
]
}
}After Configuration
Run prebuild to apply the permissions:
npx expo prebuildOr if using EAS Build, permissions are applied automatically during the build process.
Web Platform
The SDK auto-detects "ios" and "android" platforms. When using React Native Web or integrating from a web app, pass platform: "web" in the metadata:
await submitFeedback({
message: "Feedback from web",
category: "idea",
metadata: { platform: "web" },
});Development
See the root CONTRIBUTING.md for development setup.
Testing
# Run tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:coverageBuilding
# Regenerate OpenAPI types and build
pnpm buildVersioning
This package follows Semantic Versioning. Releases are automated via GitHub Actions when changes are merged to main.
Current version: See package.json
License
Apache-2.0
