> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nonefivem.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> How to install the NoCloud Node.js SDK

## Package Installation

Install the SDK using your preferred package manager:

<CodeGroup>
  ```bash npm theme={null}
  npm install @nocloud/sdk
  ```

  ```bash bun theme={null}
  bun add @nocloud/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @nocloud/sdk
  ```

  ```bash yarn theme={null}
  yarn add @nocloud/sdk
  ```
</CodeGroup>

## Quick Start

```typescript theme={null}
import { NoCloud } from "@nocloud/sdk";

// Initialize with your API key
const cloud = new NoCloud("your-api-key");

// Upload a file
const file = new File(["Hello, NoCloud!"], "hello.txt", { type: "text/plain" });
const { id, url } = await cloud.storage.upload(file);

console.log(`Uploaded: ${url}`);

// Delete when done
await cloud.storage.delete(id);
```

<Note>
  You can get your API key from the [NoCloud
  Dashboard](https://dash.nonefivem.com).
</Note>

## Configuration Options

You can pass an options object for more control:

```typescript theme={null}
const cloud = new NoCloud({
  apiKey: "your-api-key",
  baseUrl: "https://api.nonefivem.com", // optional, default API URL
  basePath: "/cloud", // optional, default base path
  retries: 3, // optional, retry attempts (default: 3)
  retryDelayMs: 1000 // optional, delay between retries (default: 1000ms)
});
```

| Option         | Type     | Default                     | Description                                  |
| -------------- | -------- | --------------------------- | -------------------------------------------- |
| `apiKey`       | `string` | —                           | **Required.** Your NoCloud API key           |
| `baseUrl`      | `string` | `https://api.nonefivem.com` | API base URL                                 |
| `basePath`     | `string` | `/cloud`                    | Base path for API endpoints                  |
| `retries`      | `number` | `3`                         | Number of retry attempts for failed requests |
| `retryDelayMs` | `number` | `1000`                      | Delay in ms between retry attempts           |

## Compatibility

The SDK works in both Node.js and browser environments:

* **Node.js**: Version 18 or higher (uses native `fetch`)
* **Browser**: All modern browsers with `fetch` support

No Node-specific APIs are used, making it fully compatible with edge runtimes and browser environments.
