| name | appgram-react-native-sdk |
|---|---|
| description | Integrate or maintain the Appgram React Native SDK (@appgram/react-native): install peers, configure AppgramProvider, use built-in components/hooks for feedback, roadmap, releases, help center, support, surveys, blog, status, chat, apply theming, and run build/lint/docs tasks. |
- You need to embed Appgram feedback/roadmap/changelog/help/support/surveys/blog/status/chat in a React Native app.
- You are wiring Appgram headless hooks into custom UI.
- You are maintaining this SDK: build, lint, docs, publish, or debugging peer/native issues.
- React Native ≥0.70, React 18, Metro; iOS requires CocoaPods, Android uses autolinking.
- Peer deps:
@react-native-async-storage/async-storage,lucide-react-native,react-native-svg,react-native-markdown-display,react-native-render-html. - Install peers after the SDK, then
npx pod-installfor iOS.
- Install:
npm install @appgram/react-nativethen peer depsnpm install @react-native-async-storage/async-storage lucide-react-native react-native-svg react-native-markdown-display react-native-render-html. - iOS: run
npx pod-installafter installing peers. - Wrap your app once:
<AppgramProvider config={{ projectId: 'YOUR_PROJECT_ID', orgSlug: 'org', projectSlug: 'project', apiUrl: 'https://api.appgram.dev', theme: { mode: 'system' } }}>
{children}
</AppgramProvider>- Use ready UI or headless hooks:
<WishList onWishPress={(wish) => console.log(wish)} />
<SupportForm onSuccess={() => Alert.alert('Sent')} />
// Hooks
const { wishes, isLoading, refetch } = useWishes()
const { vote } = useVote()- Feedback:
WishList,WishCard,VoteButton,WishDetailModal,SubmitWishSheet→useWishes,useVote,useComments. - Roadmap:
RoadmapBoard→useRoadmap. - Releases/Changelog:
Releases,ReleaseList,ReleaseDetail→useReleases,useRelease. - Help Center:
HelpCenter,HelpFlowCard,HelpFlowDetail,HelpArticleCard,HelpArticleDetail→useHelpCenter,useHelpFlow,useHelpArticle. - Support & Forms:
SupportForm,FormRenderer→useSupport,useForm,useFormSubmit. - Surveys:
SurveyForm→useSurvey,useSurveySubmit. - Blog:
Blog,BlogList,BlogCard,BlogPostDetail→useBlogPosts,useBlogPost,useBlogCategories,useFeaturedPosts. - Status:
StatusBoard→useStatus. - Chat:
ChatScreen(ChatSourcetype available) – pull data via context client as needed. - Base UI bits:
Button,Card,Badge,Inputfor consistent styling.
Hook pattern: hooks return data + isLoading (and often error, refetch); many accept refreshInterval and filter props (see exported option/result types).
- Hooks: see
references/hooks.md(options, return shapes, behaviors like refreshInterval and fingerprinting). - Components: see
references/components.md(purpose + key props per component).
AppgramProvider.config:projectId(required),orgSlug/projectSlugfor routing.apiUrloverride for self-host/staging (defaulthttps://api.appgram.dev).enableFingerprinting(default true) uses AsyncStorage + device info for anonymous votes.theme:mode(light|dark|system), optionallightColors/darkColorspartial overrides; defaults from Hazel design system.
- Access context:
useAppgramContext()→{ client, config, fingerprint, theme }. - Theming in custom UI:
useAppgramTheme()→{ colors, spacing, radius, typography, isDark, mode }; palette exportslightColors,darkColors, scalesspacing,radius,typographyfor reuse.
const { colors, spacing, radius } = useAppgramTheme()
return (
<Card style={{ backgroundColor: colors.background, padding: spacing.lg, borderRadius: radius.lg }}>
<WishList submitButtonText=\"Suggest a feature\" />
</Card>
)- Get the instantiated
AppgramClientfrom context:const { client } = useAppgramContext(). - Methods mirror hooks (e.g.,
client.getWishes,client.vote,client.getRoadmap); responses followApiResponse/PaginatedResponsetypes exported fromtypes. - Use when you need imperative flows (e.g., prefetch before navigation) or custom caching.
- Install dev deps:
npm install. - Lint:
npm run lint; typecheck:npm run typecheck. - Build package:
npm run build(builder-bob, outputs tolib/); runs automatically onnpm installviaprepare. - Docs:
npm run docs:json(typedoc) →docs.json;npm run docs:transform(usestransform-docs.js);npm run docs:buildto do both. - Publish (when ready):
npm run release(assumes npm auth + version bump). Keepreact-native-builder-bobconfig inpackage.json; build usestsconfig.build.json.
- Install order, pod install, Gradle check, cache clears, and platform notes:
references/platform-setup.md.
- Custom vote button: use
useVote; passonVoteto sync local counts; guard for missing fingerprint by showing a prompt to enable cookies/storage. - Support with magic link: use
useSupport; callrequestMagicLink(email)thenverifyToken(token); tickets also saved locally (storedTickets,clearStoredTickets). - Embed changelog tab: stack navigator screen with
Releases; on press, navigate to detail screen wrappingReleaseDetail. - Anonymous wishlist: keep
enableFingerprintingon (default); if privacy requires, set false and disable voting UI. - Blog index + detail:
BlogListfor landing; useuseBlogPostsif you need infinite scroll; route toBlogPostDetailon press. - Status page banner: call
useStatus({ slug, refreshInterval: 60000 })and render a small inline banner withdata.status. - See ready-to-paste code in
references/snippets.md.
- Missing peer deps / native linking: ensure all peers installed; run
npx pod-installfor iOS; clear Metro cache if symbols missing. - Theming not applying: verify
theme.modenot overridden by system; pass both light/dark overrides when customizing primary/background/foreground. - Anonymous voting blocked: set
enableFingerprinting=falseif fingerprint cannot be generated, or ensure AsyncStorage works in environment. - API errors: confirm
projectId/slugs andapiUrl; useclientmethods to inspectresponse.successandresponse.error. - Version support: built for React Native ≥0.70 and React 18+. Ensure
react-native-svgandlucide-react-nativeversions stay compatible.
- Hooks options/returns:
references/hooks.md - Components props notes:
references/components.md - API client methods + notes:
references/api-client.md - Platform setup & debugging:
references/platform-setup.md - Practical code snippets:
references/snippets.md