> For the complete documentation index, see [llms.txt](https://docs.stacksync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacksync.com/two-way-sync/connectors/postgres/authorize-postgres/heroku.md).

# Heroku

For Heroku, use the "Postgres Heroku" connector.

#### 1. Go to <https://dashboard.heroku.com/apps>

#### 2. Open one of your apps

<figure><img src="/files/xjY3V1ySo9Ight3AJgXW" alt=""><figcaption></figcaption></figure>

#### 3. Open your database add-on

<figure><img src="/files/MOBLCeBWNAneUh1ifQQ8" alt=""><figcaption></figcaption></figure>

#### 4. Go to settings and view Database credentials

<figure><img src="/files/IOuVZbAoEMhn0PK762Gx" alt=""><figcaption></figcaption></figure>

#### 5. Copy Connection URI

<figure><img src="/files/782G6RSuT2CaqIbn1Or1" alt=""><figcaption></figcaption></figure>

#### 6. Paste the connection URI into Stacksync to connect your database

<figure><img src="/files/gYk8yIl1tO8kdfb3k8gb" alt=""><figcaption><p>Paste your connection URL to connect your database</p></figcaption></figure>

{% hint style="info" %}
For the Heroku connector, the user is required to have the **Create** privilege on the database.

This privilege can be enabled for the user using the following SQL query:

```sql
GRANT CREATE ON DATABASE database_name TO user_name;
```

{% endhint %}

Finally, click "Authorize App" to connect!

That's it, your Postgres Heroku instance is connected! 🎉


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.stacksync.com/two-way-sync/connectors/postgres/authorize-postgres/heroku.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
