> For the complete documentation index, see [llms.txt](https://outerbase.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://outerbase.gitbook.io/untitled/introspection/connect-a-data-source.md).

# Connect a data source

Introspecting your database requires access to your database. The safest way to connect to your database and analyze the tables, column constraints, foreign keys and more is by attaching your database to Outerbase.

{% hint style="info" %}
Outerbase is a security-first company with SOC2 Type II and HIPAA certifications. Database credentials are securely encrypted and safely stored. For more information [visit our security page](https://www.outerbase.com/security/).
{% endhint %}

## Create an Outerbase account

Visit our [platform website](https://app.outerbase.com) to create an account.

## Add a new Base

Once you are logged into an your account, by default you will be inside one of your workspaces. Whichever workspace you want to add your database, or Base, to make sure you switch to it first.

Now you're ready to [follow our documentation](https://docs.outerbase.com/bases/overview) on how to create a new Base.

## Fetch your API token

To utilize Outerbase features outside of the platform user interface you will need your Base's API key. This key can be revoked at any time and re-generated, and is directly link solely to this particular database.

To find it, follow the steps below:

1. Navigate to the desired base.
2. Navigate to **Base Settings** on the bottom-left side of your screen.
3. Under the *API Key* section, click 'Generate API Key'.
4. Copy your API key.

Now you're ready to start using the Outerbase connection type provided by the SDK in your application.

<pre class="language-typescript"><code class="lang-typescript"><strong>const connection = new OuterbaseConnection(
</strong>    'YOUR_API_KEY'
<strong>)
</strong></code></pre>


---

# 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://outerbase.gitbook.io/untitled/introspection/connect-a-data-source.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.
