Skip to main content

Package Installation

Install the SDK using your preferred package manager:
npm install @nocloud/sdk

Quick Start

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);
You can get your API key from the NoCloud Dashboard.

Configuration Options

You can pass an options object for more control:
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)
});
OptionTypeDefaultDescription
apiKeystringRequired. Your NoCloud API key
baseUrlstringhttps://api.nonefivem.comAPI base URL
basePathstring/cloudBase path for API endpoints
retriesnumber3Number of retry attempts for failed requests
retryDelayMsnumber1000Delay 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.