> For the complete documentation index, see [llms.txt](https://docs.shinkro.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shinkro.com/configuration/shinkro-configuration.md).

# shinkro Configuration

Configure shinkro so it can work it's magic!

## Connect your MyAnimeList Account

### Go to Settings -> MyAnimeList Page

* Open the shinkro WebUI
* Go to Settings -> MyAnimeList

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FEdVBE9btJqUhb5bL9a1W%2F1.png?alt=media&amp;token=266ccc50-f390-4780-a42b-e1e654f01994" alt=""><figcaption></figcaption></figure>

### Copy the App Redirect URL

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FatLKyTbQ4l9mNDKdMjdu%2F2.png?alt=media&amp;token=61eb42d1-bb49-4afe-ad2e-e3084cb2e974" alt=""><figcaption></figcaption></figure>

### Create a client for accessing the MAL API on MyAnimeList.net

* Go to [MAL API](https://myanimelist.net/apiconfig) to create an ID.
* Click on **Create ID.**

App Information can be entered as follows:

App Name:&#x20;

```
<Any that you wish>
```

App Type:&#x20;

```
web
```

App Description:

```
Sync watch status between Plex and MAL using the former's webhook and the latter's API. The goal is to not have to manually update how many episodes have been watched etc.
```

App Redirect URL:&#x20;

The App Redirect URL you copied previously, should be pasted here.

```
Example: https://shinkro.domain.com/malauth/callback
```

Homepage URL:&#x20;

```
https://github.com/varoOP/shinkro
```

App Logo URL:&#x20;

```
https://raw.githubusercontent.com/varoOP/shinkro/main/.github/images/logo.png
```

Commercial / Non-Commercial:&#x20;

```
non-commercial
```

Name/ Company Name:&#x20;

<pre><code><strong>&#x3C;Any that you wish>
</strong></code></pre>

Purpose of Use:

```
hobbyist
```

Agree to the API License and Developer agreement, if you wish to.

Then, click on Submit.

**Return to the list of your API clients, and click on Edit for the one that you just created to get the Client ID and Client Secret.**

### Enter the Client ID and Client Secret & Login

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FQ7fcgS1E937YWHI6YAm2%2F3.png?alt=media&amp;token=a394ffb0-0a71-40a6-a616-b6ca7d4a2efa" alt=""><figcaption></figcaption></figure>

### Allow shinkro to access your MAL Account

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2Fhg02sNzbFt5Vq2izfR5y%2F4.png?alt=media&amp;token=9316a811-ebca-4011-be9e-5b7c2398a09b" alt=""><figcaption></figcaption></figure>

### Authentication Success

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FiqAECLFQc1tVq1VIQdsJ%2F5.png?alt=media&amp;token=a5e5031c-27dc-4221-b864-58488e17344c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FBqQJUXbMsSKn24RKMXoD%2F6.png?alt=media&amp;token=f8de75c0-a8d6-436b-9625-5d3810b23d1f" alt=""><figcaption></figcaption></figure>

## Connect your Plex Media Server

### Go to Settings -> Plex

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2F6HZQnkEMitWP5CXnAumU%2F1.png?alt=media&amp;token=53bd4c41-5145-4dda-bdbe-afe45218f0a3" alt=""><figcaption></figcaption></figure>

### Authenticate with Plex

* Click on Authenticate with Plex to login using your Plex Account
* Select your Plex Server from the dropdown
* Choose an available Host
* Pick your Anime Libraries from the list of libraries
* Edit your Plex Username if required
* Test the connection, then Save

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FFSv9Mmh0waMftqj3RNY3%2F2.png?alt=media&amp;token=7a7a89bb-9226-4652-b485-1a4d887da050" alt=""><figcaption></figcaption></figure>

### Connection Successful

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FhqjIEJsrTlbmKjsY0lYf%2F3.png?alt=media&amp;token=1e740b2e-8cb7-4134-96f5-f4125e3c2d2b" alt=""><figcaption></figcaption></figure>

## Setup either Plex or Tautulli to send webhooks to shinkro

{% hint style="warning" %} <mark style="color:$info;">**This step is important! It allows shinkro to see the watch status and rating updates from your Plex Server.**</mark>
{% endhint %}

### Create an API Key for your Plex Media Server

* Go to Settings -> General -> API Keys

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2Fq1hhnsqL7VN2LeWLTa0h%2F1.png?alt=media&amp;token=ba7636dc-3399-4a8a-a0c3-945165cb2f89" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2Fy2cM8U8qb9pnAGKJ9bNh%2F2.png?alt=media&amp;token=c4131f11-9675-48ef-b022-2d45d18a2fe3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FOYASMX3nZKFRLC8nABHe%2F3.png?alt=media&amp;token=eadee102-e20e-4596-a983-2eaa1a749986" alt=""><figcaption></figcaption></figure>

### Create the URL you need to enter on Plex / Tautulli

This URL is basically the URL to your shinkro instance which can be accessed by Plex Media Server or Tautulli along with the API Key you created for authentication.

{% hint style="warning" %}
The apiKey paramter is case-sensitive. Note that the K in apiKey is uppercase.
{% endhint %}

It follows the following format:

Without Reverse Proxy

```
http(s)://<ip_address>:<shinkro_port>/api/plex?apiKey=<apiKey created for Plex>
```

With Reverse Proxy

```
http(s)://shinkro.domain.com/api/plex?apiKey=<apiKey created for Plex>
```

#### Examples&#x20;

```
shinkro & Plex / Tautulli on same machine

http://127.0.0.1:7011/api/plex?apiKey=cb91c65f823b18d83f15477a856834fa

shinkro & Plex / Tautulli on same machine with BaseURL set to /shinkro

http://127.0.0.1:7011/shinkro/api/plex?apiKey=cb91c65f823b18d83f15477a856834fa

shinkro & Plex / Tautulli not on same machine

http://46.123.11.2:7011/api/plex?apiKey=cb91c65f823b18d83f15477a856834fa
https://shinkro.domain.com/api/plex?apiKey=cb91c65f823b18d83f15477a856834fa

shinkro & Plex / Tautulli not on same machine with BaseURL set to /shinkro

http://46.123.11.2:7011/shinkro/api/plex?apiKey=cb91c65f823b18d83f15477a856834fa
https://domain.com/shinkro/api/plex?apiKey=cb91c65f823b18d83f15477a856834fa
```

This URL needs to be the URL to your shinkro instance along with the correct API Key for authentication so that your Plex Media Server or Tautulli instance can successfully communicate with shinkro.

### Setup Plex Webhooks or Tautulli&#x20;

* **Only pick one of the two**
* Plex Webhooks is preferred but **requires Plex Pass**
* Tautulli is the free alternative but has the limitation of not being able to update ratings

#### Plex Webhooks Setup

* Login to your Plex Server
* Go to the web client of your Plex server at [Plex.tv](https://app.plex.tv/desktop/).
* Go to Settings
* Select Webhooks from the left sidebar.
* Click on Add webhook
* Enter the shinkro URL you created earlier.
* Then, click on Save Changes.

**Confirmation that shinkro is receiving payloads from Logs**

* Head to Logs
* Check for this entry - it will say ***Received empty paylod from Plex, webhook added successfully.***

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FoQrpG82bUx7LwyJacQWJ%2F4.png?alt=media&amp;token=426f50a3-583b-43d0-be93-271439969750" alt=""><figcaption></figcaption></figure>

**If you chose Plex Webhooks, that's it! shinkro is setup and ready to go.**

#### Tautulli Setup

* Go to Settings
* Click on Notification Agents
* Next, click on Add a new notification agent
* Choose Webhook from the list

**Webhook Settings**

**Configuration**

Webhook URL: The shinkro URL you created earlier

Webhook Method: POST

Triggers: Watched

Conditions: Leave default.

#### Data:

Only need to enter data for *Watched*.\
\
JSON Headers: Leave empty

JSON Data:

Copy paste the json given below:

```json
{
    "Account": {
        "title": "{username}"
    },
    "event": "media.scrobble",
    "Metadata": {
        "title": "{title}",
        "type": "{media_type}",
        "parentIndex": "{season_num}",
        "index": "{episode_num}",
        "guid": "{guid}",
        "Guid": [
            {
                "id": "imdb://{imdb_id}"
            },
            {
                "id": "tmdb://{themoviedb_id}"
            },
            {
                "id": "tvdb://{thetvdb_id}"
            }
        ],
        "grandparentKey": "/library/metadata/{grandparent_rating_key}",
        "grandparentTitle": "<episode>{show_name}</episode><movie>{title}</movie>",
        "librarySectionTitle": "{library_name}"
    }
}
```

Click on **Save**.

**Confirming shinkro is receiving webhooks from Tautulli**

* Set shinkro's log level to DEBUG from Settings -> General -> Logs
* In Tautulli, go back to your Notification Agent and select the Test Notification Tab
* Copy-paste the same json structure found above into the JSON data field, leave JSON headers blank.
* Click on Test Webhook.
* If everything went well, you will get the exact same Raw Payload in shinkro's logs. It can be viewed in the Logs section.
* Here is an example:

<figure><img src="https://2222476030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGFYi6i87YSVC4zZEifq%2Fuploads%2FxuNateScc4chgU0TWeji%2F5.png?alt=media&amp;token=c6f17293-8c6c-459f-af2a-beda0333e876" alt=""><figcaption></figcaption></figure>

* This confirms that Tautulli is successfully sending webhooks to shinkro.

That's it shinkro is configured and ready to go!
