# Overview

Currently this SDK is intended for usage in either Typescript or Javascript projects. If you are looking to have it made available for another platform or language we'd love to [hear more](https://github.com/outerbase/sdk/discussions) all about that!

## Install the package

You can add the package to your project in the ways.

{% tabs %}
{% tab title="npm" %}
`npm i @outerbase/sdk`
{% endtab %}

{% tab title="pnpm" %}
`pnpm add @outerbase/sdk`
{% endtab %}
{% endtabs %}

## How to use the SDK

Below is a chart that breaks down which features are intended for what platform use cases. All features should work on both the frontend and backend but for best practices and security purposes we find it important to explicitly enumerate them below.

| Feature        | System                          |
| -------------- | ------------------------------- |
| Data Models    | Fronten&#x64;**\*\*** & Backend |
| Remote Queries | Frontend & Backend              |
| Query Builder  | Backend                         |

## Data Models

Generating data models helps you map your data exactly as the relationships are declared in your database with the rest of your development stack. This greatly reduces ambiguity, out of sync nomenclature, and removes unnecessary manual redeclaration of classes at each layer of your application.

Since the introspection is only generating Typescript classes, there is no issues with using it on the frontend or the backend to reference those models.

_**\*\*** - We don't advise you using available methods that generate or execute SQL on the frontend, these are meant for backend purposes only. See_ [_Query Builder section_](#query-builder) _for more details as to why._

## Remote Queries

Executing network calls to saved queries within Outerbase allow you to send requests securely without exposing SQL statements to your frontend client, and only allowing a pre-determined set of SQL statements to be executable. Because of those reasons running remote queries is entirely safe on both the frontend and backend side of your development stack.

An added benefit to executing remote queries is the fact that these queries can be cached with a customized TTL (time to live) which can greatly reduce the overhead your database receives for duplicative calls, or long executing queries.

## Query Builder

Query Builder generates either a named or positional parameterized raw SQL query, accompanied by the parameters, and can be used to `.query()` and trigger a network call to your database. If that event was fired from the frontend platform then users could observe that traffic and potentially send malicious SQL statements to your database causing potentially catastrophic and unintended affects.

If you have any questions, you can reach us at [support@outerbase.com](mailto:support@outerbase.com)

{% hint style="info" %}
#### We are open source!

Every space voyage needs a crew. The Outerbase SDK is an open source project that any human being can contribute to. Add your ideas to our [Discussions](https://github.com/outerbase/sdk/discussions), report your bugs as [Issues](https://github.com/outerbase/sdk/issues), or open your first [Pull Request](https://github.com/outerbase/sdk/pulls) to add more functionality for others.
{% endhint %}
