Overview

By default, all requests timeout after 60 seconds. You can customize timeout settings globally or per-request.

Global Configuration

Set default timeout when initializing the SDK:

import GboxSDK from "gbox-sdk";

const gboxSDK = new GboxSDK({
  apiKey: process.env["GBOX_API_KEY"],
  timeout: 30 * 1000, // 30 seconds (default is 60 seconds)
});

Per-Request Configuration

Override timeout for specific operations:

// Short timeout for fast operations like listing
const boxes = await gboxSDK.listBoxes(
  {},
  { timeout: 10 * 1000 } // 10 seconds
);