> For the complete documentation index, see [llms.txt](https://docs.uibakery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uibakery.io/on-premise/additional-configurations/google-sheets-connection-setup.md).

# Google Sheets connection setup

The on-premise version of UI Bakery needs additional configuration to be able to work with Google Sheets datasource

{% hint style="warning" %}
Google requires using **https\://** as the scheme of Authorized redirect URI for Production apps.

Also, redirect URI **must** contain a top private domain and should end with a public [top-level domain](https://github.com/google/guava/wiki/InternetDomainNameExplained#public-suffixes-and-private-domains) (such as .com or .org). The only exception is *localhost* (for testing the connection locally).

If your UI Bakery instance is using a custom [domain name](/on-premise/networking-and-security/setting-up-a-domain-name.md) — please ensure to [put it](/on-premise/install-and-update/updating-environment-variables.md) in the `UI_BAKERY_APP_SERVER_NAME` variable.

If you don't have a private domain yet (e.g. just deployed your instance on AWS) but want to test the Google Sheets connection — you can use 3rd-party service [nip.io](https://nip.io/) for testing purposes. Just replace dots with dashes and append ".nip.io" to your static IP address like `192-168-1-250.nip.io`
{% endhint %}

1. Create a new [Google Cloud Console](https://console.cloud.google.com/) project or choose an existing one
2. Configure the [OAuth Consent Screen](https://console.cloud.google.com/apis/credentials/consent) with User Type = **External** and Publishing Status = **Production**
3. Go to the [**API & Services**](https://console.cloud.google.com/apis/dashboard) section
4. Click **ENABLE APIS AND SERVICES** and enable [Google Sheets API](https://console.cloud.google.com/apis/library/sheets.googleapis.com)
5. Click on [**Create credentials**](https://console.cloud.google.com/apis/credentials/wizard?api=sheets.googleapis.com) and choose **User Data**
6. Select **Web Application** in the OAuth Client ID section
7. Add Authorized redirect URI with value `https://YOUR_DOMAIN_OR_LOCALHOST/gsheet-oauth-callback` (make sure to put the same domain as in the `UI_BAKERY_APP_SERVER_NAME` variable)
8. Click **Create**
9. [Put credentials](/on-premise/install-and-update/updating-environment-variables.md) in `UI_BAKERY_GSHEET_CLIENT_ID` and `UI_BAKERY_GSHEET_CLIENT_SECRET` variables
10. Restart your UI Bakery instance with `docker compose up -d`


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uibakery.io/on-premise/additional-configurations/google-sheets-connection-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
