This example app demonstrates the Toadly SDK for React Native. It uses the local workspace copy of react-native-toadly, so changes to the SDK package can be tested here without publishing.
- Manually trigger the bug reporting dialog
- Include logs and device information in reports
- Automatically create GitHub issues
- Add custom log entries for business logic
- Clear logs when needed
- Enable automatic JavaScript fatal error issue submission
- Trigger a native crash for testing
- Capture successful and failed API calls through network monitoring
Before running the example app, make sure you have:
- A GitHub account with a personal access token
- A repository where issues will be created
- React Native development environment set up for iOS or Android
- Node matching the repository
.nvmrc
Create example/config.ts from the checked-in template:
cp example/config.example.ts example/config.tsThen fill in your GitHub credentials:
export const config = {
github: {
token: 'YOUR_GITHUB_TOKEN',
repoOwner: 'YOUR_GITHUB_USERNAME_OR_ORG',
repoName: 'YOUR_REPOSITORY_NAME',
},
};Do not commit a real GitHub token.
Install dependencies from the repository root:
yarn installThis project uses Yarn workspaces. If yarn is not available globally, run the pinned Yarn release directly from the repository root:
node .yarn/releases/yarn-3.6.1.cjs installFor iOS, install CocoaPods dependencies:
cd example/ios
pod install
cd ../..Run commands from the repository root.
Start Metro:
yarn example startRun on iOS:
yarn example iosRun on Android:
yarn example androidThe example app demonstrates Toadly's features through a simple interface:
- Bug Reporting: Tap "Report a Bug" to open the bug reporting dialog
- Log Management: Add custom logs and clear logs with the provided buttons
- Crash Testing: Trigger caught, fatal JavaScript, and native errors
- API Testing: Make successful and failed API calls for network logs
Toadly is initialized in App.tsx with GitHub credentials:
import * as Toadly from 'react-native-toadly';
import { config } from '../config';
const { token, repoOwner, repoName } = config.github;
Toadly.setup(token, repoOwner, repoName);
Toadly.enableAutomaticIssueSubmission(true);
Toadly.startNetworkMonitoring();Add custom logs to provide context for bug reports:
// Add a custom log
Toadly.log('User performed an action');If you encounter issues:
- Make sure your GitHub token can create issues in the target repository.
- Verify that
example/config.tsexists and matches the shape ofexample/config.example.ts. - Run commands from the repository root so the workspace dependency links resolve correctly.
- If
yarnis missing, usenode .yarn/releases/yarn-3.6.1.cjs <command>. - For iOS-specific issues, clean the build folder and reinstall pods in
example/ios. - If native code or Nitro specs changed, run
yarn nitrogenbefore rebuilding.
For more information about Toadly, check out the main README and the API documentation.