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

# Getting started

The Jet Admin SDK connects your application to resources configured in a Jet Admin project. It includes TypeScript definitions and asynchronous methods that return promises. Agent streaming uses an async generator.

### Before you start

You need:

* A Jet Admin project identifier and environment name.
* The resource and collection identifiers used by that project's API, or a workflow or agent UID. Use API identifiers rather than display labels.
* A user account permitted to access the data, with email/password login enabled for your project if you follow this example.
* A browser application with a bundler and access to `localStorage`.

The examples below use placeholder identifiers and sample fields. Replace them with identifiers and fields from your project.

### Install

The package name in this repository is `@jet-admin/jet-sdk`:

```bash
npm install @jet-admin/jet-sdk
```

Use your team's configured package registry and credentials. Package publication and registry access were not verified as part of this source review. If installation reports a missing or private package, ask the SDK maintainer for registry access or a supported package artifact.

### Read your first records

Run this from a browser application. Pass credentials from your login form; do not hard-code a real password.

```typescript
import { Jet, JetRequestError } from '@jet-admin/jet-sdk';

const jet = new Jet({
  project: 'YOUR_PROJECT',
  environment: 'prod',
});

async function loadCustomers(email: string, password: string) {
  try {
    await jet.auth.loginViaEmailPassword(email, password);
    const page = await jet.collection('YOUR_RESOURCE', 'customers').list({
      pagination: { page: 1, perPage: 25 },
    });
    return page.results.map(record => record.data);
  } catch (error) {
    if (error instanceof JetRequestError) {
      console.error(error.message, error.fieldErrors);
    }
    throw error;
  }
}
```

Each record is a `CollectionRecord`. Access your fields through `record.data`, for example `record.data.name`. Collection records are not generic typed models; field values have type `unknown` until your application validates or narrows them.

### Choose your next step

| Task                                            | SDK entry point                        | Guide                                                                           |
| ----------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------- |
| List, filter, create, update, or delete records | `jet.collection(resource, collection)` | [Collections](/api-reference/javascript-sdk/collections.md)                     |
| Execute a resource action                       | `jet.action(resource, action)`         | [Actions and workflows](/api-reference/javascript-sdk/actions-and-workflows.md) |
| Run a workflow                                  | `jet.workflow(uid)`                    | [Actions and workflows](/api-reference/javascript-sdk/actions-and-workflows.md) |
| Upload and browse files                         | `jet.storage(resource, storage)`       | [File storage](/api-reference/javascript-sdk/storage.md)                        |
| Prompt an agent and manage conversations        | `jet.agent(uid)`                       | [AI agents](/api-reference/javascript-sdk/agents.md)                            |
| Sign users in and manage their accounts         | `jet.auth`                             | [Authentication](/api-reference/javascript-sdk/authentication.md)               |

### Runtime compatibility

Initialize the SDK on the client in applications that render on a server. `new Jet(...)` reads `localStorage` immediately, even when an API token is supplied. Storage uploads also reference `File`, `Blob`, and `FormData`. Agent streaming requires `fetch`, readable streams, and `TextDecoder`.

The repository does not declare a supported Node.js version or provide a server storage adapter. Do not use shared global authentication storage for multiple users on a server. See [service requests and server use](/api-reference/javascript-sdk/authentication.md#service-requests-and-server-use).


---

# 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.jetadmin.io/api-reference/javascript-sdk/getting-started.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.
