# Create Integration on the Pandium Integration Hub

Now you will create Pandium's record of the integration which will eventually be used to run your code. You'll also let Pandium generate the initial files for your new integration!

1. Use the command line to create a new branch on a remote repository where Pandium can put the starter files it will generate for your Pokémon integration:&#x20;
   * [ ] This branch must be made on a repository which your [source control tenant](https://docs.pandium.com/reference/source-control) is authorized to access.
   * [ ] For example, run `git checkout -b pokemon-integration`.
   * [ ] Publish the new branch to the online repository (assuming the remote repository is named `origin`).  Run `git push -u origin pokemon-integration`. &#x20;
2. Log into your [sandbox Pandium Integration Hub. ](https://admin.sandbox.pandium.com/)

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FRALvn090pyixF0T1pimn%2Fimage.png?alt=media&#x26;token=88bcb0a6-0aa8-48b1-97b6-1b6d267e6764" alt="" width="375"><figcaption></figcaption></figure>

3. From the sidebar menu choose **Integrations.**  This will display the main *Integrations* page.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FdJeYs1MfFCJu3N9T5k2u%2Fimage.png?alt=media&#x26;token=6fba6f25-b163-482f-903b-7266e4142f67" alt=""><figcaption></figcaption></figure>

4. In the upper right corner click **Create.**  This will display the *New Integration* dialog box.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FcSwkzFJBQ51VqpVZ6qSh%2Fimage.png?alt=media&#x26;token=378d925d-ce95-4221-aaaa-a90b09cbd434" alt="" width="375"><figcaption></figcaption></figure>

5. Choose **Internal** because your Pokémon integration will run on Pandium.
   * You can read more about the different kinds of integrations [here](https://docs.pandium.com/key-terminology#integration).
6. Click **Create.**  This will display the *Configure* tab for the *New Integration* page.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2Fe6NAl2dWmXDvMeLDiE4G%2Fimage.png?alt=media&#x26;token=562f617c-9245-4c82-beb9-1ca4bb5fb8b2" alt="" width="341"><figcaption></figcaption></figure>

7. Under *Connectors* click the dropdown menu to open it.
8. Select **Slack (OAuth2)** from the list of Connectors. &#x20;
   * Do not check the box for *Global* because this is not a Global connector (you can read more about the different kinds of connectors and their purposes [here](https://docs.pandium.com/key-terminology#connector)).
   * You do not need to add a connector for the PokéAPI because you'll be able to fetch information from it without providing any auth.
9. Under *Details* enter an **Integration ID** and **Integration Name**.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FX167WV5QSa1IVnYIaxuT%2Fimage.png?alt=media&#x26;token=468364aa-96a7-4020-b2e4-8bfd765bef98" alt=""><figcaption><p>In this example the remote repository is at <a href="https://github.com/pandium/sample_integrations.git">https://github.com/pandium/sample_integrations.git</a>.  In step 1 the pokemon-integration branch was added to that repository.  The repository path tells Pandium to create a folder called POKEMON_OF_THE_DAY within that repository, and to add the starter files to that folder.</p></figcaption></figure>

10. Under *Remote Repository Settings,* do the following:
    * [ ] For *Repository Url,* enter the url for the online repository where you would like to store this integration's code.  This should be the same one on which you just made a branch in step 1.
    * [ ] For *Repository Tracking Branch,* enter the name of the branch on which you will develop this integration (e.g. `pokemon-integration`). &#x20;
    * [ ] For *Repository Path,* enter the path for a new folder in which you would like this integration to be made.
11. Under *Sync Schedule,* for *Default schedule for a new tenant* choose **Once Per Day** since the integration is called *Pokémon* ***of the day.***
12. &#x20;Click **Create.**  This will display the *Provision* tab. &#x20;

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FTNLmQLufN9UNfwvYQzc7%2Fimage.png?alt=media&#x26;token=208f6a30-273d-446a-8d17-77cb9983ad9f" alt="" width="363"><figcaption></figcaption></figure>

13. Enter the **Client ID** and **Client Secret** you got when you created the Slack App.
14. In the dropdown menu for *Scope* select **users:read** and **chat:write**.
15. Leave *User Scope* blank.
16. Click **Provision**.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FSmNetUeeJ6vWTncsCcWt%2Fimage.png?alt=media&#x26;token=dff62849-f962-4f44-8a3c-77e234c8985d" alt="" width="372"><figcaption></figcaption></figure>

17. Click **Show Secret Keys** for the *Slack (OAuth2)* connector.  Make note of  PAN\_SEC\_SLACK\_OAUTH\_ACCESS\_TOKEN displayed in the dialog box. You will use this in your .env when you develop the integration locally.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FmjivWuGgPdGCBpIwOX1C%2Fimage.png?alt=media&#x26;token=5dfedc1d-a3f3-44fa-8d3a-ee605ed7ffe0" alt="" width="375"><figcaption></figcaption></figure>

18. Click **Close** to exit the connector secret keys dialog box.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FN1x3mjfmopkPdI6RatAf%2Fimage.png?alt=media&#x26;token=75159b58-9dfa-4558-9952-28ac1219553d" alt="" width="372"><figcaption></figcaption></figure>

19. Click **Done**. This will display the integration details page.

The next step requires that your sandbox Integration Hub has its Source control tenant set up.  If you haven't already done that, following [these instructions](https://docs.pandium.com/reference/source-control).

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2Fr6mCIKB4zFuUK5mMnjsu%2Fimage.png?alt=media&#x26;token=3ad8e17f-1fca-4bf0-abec-8c017880b638" alt=""><figcaption></figcaption></figure>

20. &#x20;Click **Setup Integration Repo.**  This will display the dialog box to A*dd Pandium files to your repo.*

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FY9YNklg7j9VJ0XGpcXxC%2Fimage.png?alt=media&#x26;token=70e48e9f-4287-44ed-ac68-7fd0c2d83bc1" alt="" width="244"><figcaption></figcaption></figure>

21. For *Language,* choose **Typescript**.
22. &#x20;Click **Setup Repo.**  This will display the *Source Control* tab for the *Admin Settings* page and kick off a run of your source control tenant.  That run will generate a some files to jump start the process of writing the code for this integration.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2FrdQ9oUIkMfaR51riYL3X%2Fimage.png?alt=media&#x26;token=2245ddc3-4e37-448b-bbe1-31b7188f22c5" alt=""><figcaption></figcaption></figure>

23. &#x20;Once that source control run is complete run `git pull origin pokemon-integration` to fetch the newly created files.  They will help you start writing your integration!
