# Publish a module that uses TSS

{% tabs %}
{% tab title="Your module uses MUI" %}
`package.json`

```json
"name": "YOUR_MODULE",
"dependencies": {
    "tss-react": "^4.0.0"
},
"peerDependencies": {
    "react": "^16.8.0 || ^17.0.2 || 18.0.0" ,
    "@mui/material": "^5.9.3 || ^6.0.0",
    "@emotion/react": "^11.4.1",
},
"devDependencies": {
    "@mui/material": "^5.0.1",
    "@emotion/react": "^11.4.1",
    "@emotion/styled": "^11.8.1"
}

```

Your users install your module like that:&#x20;

```bash
yarn add YOUR_MODULE @mui/material @emotion/react @emotion/styled
```

{% hint style="info" %}
The version of `@mui/material` must be newer or equal to `5.9.3`
{% endhint %}

Regarding SSR setup you can forward your user to the dedicated [MUI documentation](https://mui.com/material-ui/guides/server-rendering/).
{% endtab %}

{% tab title="Your module don't use MUI" %}
`package.json`

```json
"name": "YOUR_MODULE",
"dependencies": {
    "tss-react": "^4.0.0"
},
"peerDependencies": {
    "react": "^16.8.0 || ^17.0.2 || ^18.0.0",
    "@emotion/react": "^11.4.1",
},
"devDependencies": {
    "@emotion/react": "^11.4.1"
}

```

Your users install your module like that:&#x20;

```bash
yarn add YOUR_MODULE @emotion/react
```

Regarding SSR setup you can forward your user to [the dedicated documentation](https://docs.tss-react.dev/ssr).
{% endtab %}
{% endtabs %}

In any case, it is of paramount importance that your library supports CSJ and ESM distribution. Please refer to the following discussion for precise instructions and a comprehensive explanation of why this is crucial. &#x20;

{% embed url="<https://github.com/garronej/tss-react/issues/136#issuecomment-1549661726>" %}

{% hint style="warning" %}
Wherever you make use of [nested selectors](https://docs.tss-react.dev/nested-selectors) you must [provide a `uniqId`](https://docs.tss-react.dev/nested-selectors#ssr) to make sure your components will works in every SSR setup.
{% endhint %}

{% hint style="warning" %}
You should avoid using `<TssCacheProvider />` or you should make `tss-react` as peerDependency of your module which you probably want to avoid. &#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tss-react.dev/publish-a-module-that-uses-tss.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
