> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/sdk/typescript.md).

# TypeScript

The database and other services we do provide have [REST API](/api/how-to-test.md) on top of it. So each interaction and much more are available using our robust API. (Please check the [API documentation section](/api/how-to-test.md)).&#x20;

Even though working with API can be less joyful than having a well-prepared SDK (Software Development Kit) for your programming language. For this reason, we provide ready-to-production **TypeScript SDK** that allows you to quickly handle tedious tasks and focus more on your app.

{% hint style="info" %}
**Prerequisites**.&#x20;

Before you jump in, please make sure you have [CodeMash API Key](/api/get-started.md).&#x20;
{% endhint %}

### Get Started

#### Install CodeMash via NPM

1. Using your preferred code editor (Visual Studio Code, JetBrains WebStorm, Atom or any else) or terminal, open your project.
2. Add codemash package into your project using one of the following commands:

{% code title="# using npm" %}

```bash
npm install codemash
```

{% endcode %}

{% code title="# using yarn" %}

```bash
yarn add codemash
```

{% endcode %}

You can find the CodeMash npm package [here](https://www.npmjs.com/package/codemash).

#### Download from source code

Source code is available at <https://github.com/codemash-io/CodeMash.Js>

You can go to the Releases section and download the build version from the release assets.&#x20;

### Database

#### Collections

{% content-ref url="/pages/-M-65jjrfIc8PPDnElLW" %}
[Find](/api/database/collections/find.md)
{% endcontent-ref %}


---

# 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.codemash.io/sdk/typescript.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.
