Skip to content

Commit

Permalink
add doc, edited with a question
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroot committed Jul 16, 2024
1 parent 288a8b1 commit a070b61
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions third-party-tools/embeddable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: Embeddable
description:
Embeddable is a developer toolkit for building fast, interactive, fully-custom
analytics experiences directly into your app.
---

Embeddable is a developer toolkit for building fast, interactive customer-facing
analytics. It works well with a high performance time-series database like
QuestDB.

In [Embeddable](https://embeddable.com) define
[Data Models](https://trevorio.notion.site/Data-modeling-35637bbbc01046a1bc47715456bfa1d8)
and
[Components](https://trevorio.notion.site/Using-components-761f52ac2d0743b488371088a1024e49)
in code stored in your own code repository, then use the **SDK** to make these
available for your team in the powerful Embeddable **no-code builder.** The end
result is the ability to deliver fast, interactive **customer-facing analytics**
directly in your product.

Built-in **row-level security** means that every user only ever sees **exactly**
the data they’re allowed to see. And two levels of fully-configurable
**caching** mean you can deliver fast, realtime analytics at scale.

## Prerequisites

- A running QuestDB instance
- Not running yet? See the [quick start](/docs/quick-start/)

## Getting started with Embeddable

Add a database connection using Embeddable API. This connection connects to your
QuestDB instance. To add a connection, use the following API call:

```javascript
// for security reasons, this must *never* be called from your client-side
fetch("https://api.embeddable.com/api/v1/connections", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${apiKey}` /* keep your API Key secure */,
},
body: JSON.stringify({
name: "my-questdb-db",
type: "questdb",
credentials: {
host: "my.questdb.host",
port: "8812",
user: "admin",
password: "quest",
},
}),
})
```

In response you will receive:

```json
Status 201 { errorMessage: null }
```

The above represents a `CREATE` action, but all `CRUD` operations are available.

The `apiKey` can be found by clicking “**Publish**” on one of your Embeddable
dashboards.

The `name` is a unique name to identify this **connection**.

- By default your **data models** will look for a **connection** called
“default”, but you can supply your models with different
[**data_source**](https://cube.dev/docs/reference/data-model/cube#data_source)
names to support connecting different **data models** to different
**connections** (simply specify the
**[data_source](https://cube.dev/docs/reference/data-model/cube#data_source)**
name in the model)

The `type` tells us which driver to use, in this case QuestDB. For a full list,
see
[the documentaiton](https://cube.dev/docs/product/configuration/data-sources).

The `credentials` is a javascript object containing the necessary credentials
expected by the driver:

- These are securely encrypted and only used to retrieve exactly the data you
have described in your data models.
- We strongly encourage you to create a **read-only** database user for each
connection. Embeddable will only ever read from your database, not write.

To support connecting to different databases for prod, qa, test, etc, or to
support different databases for different customers, you can assign each
**connection** to an **environment**. For more information, see
[Environments API](https://www.notion.so/Environments-API-497169036b5148b38f7936aa75e62949?pvs=21).

0 comments on commit a070b61

Please sign in to comment.