React Native
The FeedbackJar React Native SDK lets you submit feedback and list public posts from iOS and Android apps. You build your own form — the SDK handles submission with device metadata attached.
- Package:
@feedbackjar/react-native-sdk - Min React Native: 0.70.0
- Platforms: iOS & Android
Installation
npm install @feedbackjar/react-native-sdk No native modules required — the SDK uses React Native’s built-in fetch, Platform, and Dimensions APIs.
Setup
Configure once before use, typically in your root App.tsx:
import { FeedbackJar } from '@feedbackjar/react-native-sdk';
FeedbackJar.configure({ widgetId: 'your-widget-id' }); Get your widget ID from Settings → Widgets in your FeedbackJar workspace.
Submit feedback
Submissions are anonymous. Each submission automatically includes device metadata (OS version, screen size, locale, timezone).
const result = await FeedbackJar.submit(userText);
if (result.ok) {
console.log('Submitted:', result.value.postId);
} else {
console.error('Failed:', result.error.message);
} A callback variant is available when you are not in an async context:
FeedbackJar.submit(userText, (result) => {
if (result.ok) {
// show success state
}
}); List feedback
Fetch the public feedback feed with optional pagination:
const result = await FeedbackJar.listFeedback({ limit: 20 });
if (result.ok) {
for (const post of result.value.posts) {
console.log(`${post.title} — ${post.upvotes} upvotes`);
}
} Pass boardId to filter by board, or cursor for pagination.
API reference
| Method | Description |
|---|---|
configure({ widgetId }) | Configure the SDK. Call once before anything else. |
submit(content) | Submit anonymous feedback. Returns FeedbackJarResult<FeedbackResponse>. |
listFeedback({ boardId?, limit?, cursor? }) | List public feedback. limit is clamped to 1–50. |
All methods return a discriminated union — nothing throws on network errors:
type FeedbackJarResult<T> =
| { ok: true; value: T }
| { ok: false; error: Error }; Notes
- Only anonymous submission is supported — no user identity is sent.
- The server rate-limits submissions (5 per 15 minutes per IP).
- Private boards and non-public posts are never returned by
listFeedback.