Gathering detailed insights and metrics for react-native-network-logger
Gathering detailed insights and metrics for react-native-network-logger
Gathering detailed insights and metrics for react-native-network-logger
Gathering detailed insights and metrics for react-native-network-logger
react-native-netwatch
Network traffic logger for React Native
react-native-requests-logger
Log all network requests made in react native apps into chrome dev tools network tab.
rn-vconsole-panel
A Logger that runs on the device is the same as the chrome console or vconsole. rn-vconsole-panel can log the Console, Network, Router Stack, Storage, System Info automatic.
react-native-ws-logger
An out-of-the-box websocket network viewer
npm install react-native-network-logger
Typescript
Module System
Node Version
NPM Version
60.4
Supply Chain
60.4
Quality
70.3
Maintenance
50
Vulnerability
93.6
License
TypeScript (97.65%)
JavaScript (2.35%)
Total Downloads
2,597,852
Last Day
1,020
Last Week
25,031
Last Month
111,346
Last Year
1,125,268
560 Stars
138 Commits
49 Forks
10 Watching
3 Branches
7 Contributors
Latest Version
1.17.0
Package Id
react-native-network-logger@1.17.0
Unpacked Size
386.34 kB
Size
77.33 kB
File Count
225
NPM Version
10.5.0
Node Version
20.12.2
Publised On
24 Sept 2024
Cumulative downloads
Total Downloads
Last day
2%
1,020
Compared to previous day
Last week
-14%
25,031
Compared to previous week
Last month
-19.1%
111,346
Compared to previous month
Last year
52.3%
1,125,268
Compared to previous year
2
An HTTP traffic monitor for React Native including in app interface.
An alternative to Wormholy but for both iOS and Android and with zero native dependencies.
If this project has helped you out, please support us with a star 🌟.
1yarn add react-native-network-logger
or
npm install --save react-native-network-logger
Call startNetworkLogging
in your apps entry point to log every request, or call it on a button press to manually trigger it.
1import { startNetworkLogging } from 'react-native-network-logger'; 2 3startNetworkLogging(); 4AppRegistry.registerComponent('App', () => App);
1import NetworkLogger from 'react-native-network-logger'; 2 3const MyScreen = () => <NetworkLogger />;
You can change between the dark and light theme by passing the theme
prop with "dark"
or "light"
.
1import NetworkLogger from 'react-native-network-logger'; 2 3const MyScreen = () => <NetworkLogger theme="dark" />;
If preferred you can also override the theme entirely by passing in a theme object.
Note: breaking theme changes are not guaranteed to follow semver for updates
1import NetworkLogger from 'react-native-network-logger'; 2 3const MyScreen = () => ( 4 <NetworkLogger 5 theme={{ 6 colors: { 7 background: 'red', 8 }, 9 }} 10 /> 11);
You can configure the max number of requests stored on the device using by calling startNetworkLogging
with the maxRequests
option. The default is 500
.
1startNetworkLogging({ maxRequests: 500 });
You can configure hosts that should be ignored by calling startNetworkLogging
with the ignoredHosts
option.
1startNetworkLogging({ ignoredHosts: ['test.example.com'] });
You can configure urls that should be ignored by calling startNetworkLogging
with the ignoredUrls
option.
1startNetworkLogging({ ignoredUrls: ['https://test.example.com/page'] });
You can configure url patterns, including methods that should be ignored by calling startNetworkLogging
with the ignoredPatterns
option.
1startNetworkLogging({
2 ignoredPatterns: [/^GET http:\/\/test\.example\.com\/pages\/.*$/],
3});
The pattern to match with is the method followed by the url, e.g. GET http://example.com/test
so you can use the pattern to match anything, e.g. ignoring all HEAD requests.
1startNetworkLogging({ 2 // Ignore all HEAD requests 3 ignoredPatterns: [/^HEAD /], 4});
Set the sort order of requests. Options are asc
or desc
, default is desc
(most recent at the top).
1import NetworkLogger from 'react-native-network-logger'; 2 3const MyScreen = () => <NetworkLogger sort="asc" />;
Set the maximum number of rows to display in the list to improve rendering. Default is same as request limit.
1import NetworkLogger from 'react-native-network-logger'; 2 3const MyScreen = () => <NetworkLogger maxRows={100} />;
Make the rows smaller to fit more on the screen.
1import NetworkLogger from 'react-native-network-logger'; 2 3const MyScreen = () => <NetworkLogger compact />;
If you are running another network logging interceptor, e.g. Reactotron, the logger will not start as only one can be run at once. You can override this behaviour and force the logger to start by using the forceEnable
option.
1startNetworkLogging({ forceEnable: true });
Use your existing back button (e.g. in your navigation header) to navigate within the network logger.
1import NetworkLogger, { getBackHandler } from 'react-native-network-logger'; 2 3const navigation = useNavigation(); 4const onBack = getBackHandler(navigation.goBack); 5 6const MyScreen = () => ( 7 <Screen onBackPressed={onBack}> 8 <NetworkLogger /> 9 </Screen> 10);
To test the example app, after cloning the repo, install the required dependencies by running:
1yarn bootstrap
Then start the example app by running:
1yarn example start
You should then be able to open the expo server at http://localhost:3000/ and launch the app on iOS or Android.
For more setup and development details, see Contributing.
Network requests can be debugged using tools such as React Native Debugger, however this requires both a debug build of the app and the debugger to be enabled. This library can be built with you app and usable by anyone using your app to see network issues and report them back to developers.
As the library is very small you can safely bundle it with the production version of your app and put it behind a flag, or have a separate testing build of the app which has the network logger enabled.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
5 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 9/27 approved changesets -- score normalized to 3
Reason
8 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More