Documentation

Quick Start Guide

This guide will help you get started with Get Pronto's asset hosting service in just a few minutes. You'll learn how to set up your account, install the SDK, and perform basic file operations.

Step 1: Create an Account

  1. Visit https://app.getpronto.io/signup to create your Get Pronto account
  2. Complete the registration form with your information
  3. Verify your email address by clicking the link sent to your inbox
  4. Log in to your new account

Step 2: Get Your API Key

  1. Navigate to the API Keys section in your dashboard
  2. Click Create New API Key
  3. Give your key a name (e.g., "Development")
  4. Copy your new API key and store it securely

Important: Your API key will only be shown once. Make sure to copy it to a secure location. For more information on API keys, see our Authentication guide.

Step 3: Install the SDK

Install the Get Pronto SDK using npm or yarn:

bash
# Using npm
npm install getpronto-sdk

# Using yarn
yarn add getpronto-sdk

Step 4: Initialize the SDK Client

Create and initialize a Get Pronto client with your API key. Use a secret key for server-side code or a public key for browser-side uploads:

javascript
import GetProntoClient from "getpronto-sdk";

// Server-side — full access
const client = new GetProntoClient({
  apiKey: "pronto_sk_..."
});

// Or client-side — upload only (safe for browser)
const client = new GetProntoClient({
  apiKey: "pronto_pk_..."
});

Step 5: Upload Your First File

Now that you have the client set up, let's upload a file:

javascript

try {
  const result = await client.files.upload("./path/to/image.jpg");
  console.log("File uploaded successfully:", result.data);
} catch (error) {
  console.error("Upload failed:", error.message);
}

Step 6: List Your Files

Retrieve a list of your uploaded files:

javascript
try {
  const response = await client.files.list();
  console.log("Files:", response.data.files);
  console.log("Pagination:", response.data.pagination);
} catch (error) {
  console.error("Failed to list files:", error.message);
}

Step 7: Transform an Image

Get Pronto allows you to transform images on-the-fly. Here's how to generate a URL for a resized image:

javascript
// Server-side: generate a transform URL with the SDK (requires secret key)
const fileId = "YOUR_FILE_ID";

const imageUrl = await client.images
  .transform(fileId)
  .resize(800, 600)
  .grayscale()
  .quality(90)
  .toURL();

console.log("Transformed image URL:", imageUrl);

// Or use URL query parameters directly (works anywhere, no key needed):
// https://api.getpronto.io/v1/file/user-123/image.webp?w=800&h=600&gray=true&q=90

Complete Example

Here's a complete example that ties everything together:

javascript
import GetProntoClient from "getpronto-sdk";

// Server-side example using a secret key
const client = new GetProntoClient({
  apiKey: "pronto_sk_..."
});

async function uploadAndTransform() {
  try {
    // Upload a file
    const uploadResult = await client.files.upload("./image.jpg");
    console.log("File uploaded:", uploadResult.data);

    // Get the file ID
    const fileId = uploadResult.data.id;

    // Generate a URL for the transformed image
    const transformedUrl = await client.images
      .transform(fileId)
      .resize(300, 200)
      .grayscale()
      .toURL();

    console.log("Transformed image URL:", transformedUrl);

    // List all files
    const listResult = await client.files.list();
    console.log("Total files:", listResult.data.pagination.totalCount);

    return {
      originalFile: uploadResult.data,
      transformedUrl
    };
  } catch (error) {
    console.error("Error:", error.message);
  }
}

// Run the example
uploadAndTransform();

Next Steps

Continue exploring our documentation with these related topics: