> For the complete documentation index, see [llms.txt](https://react-through.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://react-through.js.org/basics/setup.md).

# Installation and setup

## Installation

To install as dependency if you use `npm`

```bash
npm install --save react-through
```

or if you use `yarn`

```bash
yarn add react-through
```

## Base configuration

Communication center must be the parent of all react elements which need to be involved in communications. The communication center is implemented in `ThroughProvider` component.

Add the `<ThroughProvider/>` component to the root of your React component tree. In the react tree the `ThroughProvider` component must be the parent of all components of this library with any deeps of nesting.

```javascript
import {ThroughProvider} from 'react-through'

const theApp = (
  <ThroughProvider>
    <App />
  </ThroughProvider>
)

ReactDOM.render(theApp, document.getElementById('root'))
```

## Individual imports

This library is very small but if you want to make your bundle as small as possible you can import each thing of this library individually rather than the entire library. Use individual imports for each export of this library, for example:

```javascript
import ThroughProvider from 'react-through/lib/ThroughProvider'
```

instead of:

```javascript
import {ThroughProvider} from 'react-through'
```

for each this library exports.

## Let's start

Now it is time to use it. It has two base methods:

* [Direct mapping](/basics/direct.md) (simple way) from one agent
* [Many agents](/basics/manyagents.md) from multiple sources of data
