Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon How do I install the Reactotron-apisauce plugin


How do I install the Reactotron-apisauce plugin


here are the steps to install the Reactotron-apisauce plugin:

1. Install the `reactotron-apisauce` package:


npm install --save-dev reactotron-apisauce

or


yarn add -D reactotron-apisauce

2. Import the `apisaucePlugin` and configure Reactotron to use it:

javascript
import Reactotron from 'reactotron-react-native';
import apisaucePlugin from 'reactotron-apisauce';

Reactotron.configure()
  .use(apisaucePlugin())
  .connect();

3. Wrap your API client (e.g., Apisauce) with Reactotron's networking plugin:

javascript
import { create } from 'apisauce';

const api = create({
  baseURL: 'https://api.example.com',
});

api.addMonitor(Reactotron.apisauce);

Now, when you make API requests using the wrapped API client, Reactotron will automatically monitor and display the requests and responses in the timeline tab.

The key steps are:

1. Install the `reactotron-apisauce` package
2. Configure Reactotron to use the `apisaucePlugin`
3. Wrap your API client with `Reactotron.apisauce`

This will allow you to view and debug the API requests and responses in the Reactotron desktop app.

Citations:
[1] https://www.npmjs.com/package/reactotron-apisauce
[2] https://www.jsdelivr.com/package/npm/reactotron-apisauce
[3] https://stackoverflow.com/questions/49269595/how-to-set-up-reactotron-apisauce-in-react-native
[4] https://docs.infinite.red/reactotron/plugins/
[5] https://snyk.io/advisor/npm-package/reactotron-react-native/functions/reactotron-react-native.configure