ICBucket
ICBucketv1.0
Overview
  • Introduction
  • Quick Start
  • Installation
Guides
  • Configuration
  • Authentication
  • Basic Usage
  • Best Practices
API Reference
  • API Overview
  • API Endpoints
  • API Requests
  • API Responses
Errors
  • Error Codes
  • Error Handling
  • Troubleshooting
Deployment
  • Local Development
  • Production Deployment
Reference
  • Configuration Reference
  • Types Reference
  • Changelog
FAQ
  • Frequently Asked Questions
PricingGitLabNew bucket
  1. ICBucket
  2. Guides
  3. Configuration

Configuration

Configure client timeouts, automatic chunk retry strategies, Edge CDN domains, and environment settings.

Configuration

The ICBucket client can be customized to match your infrastructure requirements, from serverless Next.js functions to long-running backup daemons.

Prerequisites#

  • icpay-bucket installed in your project
  • A valid API key or Internet Identity identity

Steps#

Client Options#

Initialize the client with custom network options:

import { ICBucket } from "icpay-bucket"

const bucket = new ICBucket({
  bucketId: process.env.ICBUCKET_ID!,
  apiKey: process.env.ICBUCKET_API_KEY!,
  
  // Custom Edge CDN domain (defaults to https://cloud.icpay.app)
  cdnBase: "https://cloud.icpay.app",

  // Chunk upload configuration
  chunkSizeBytes: 2 * 1024 * 1024, // 2MB default per boundary node guidelines

  // Timeout and retry parameters
  timeoutMs: 30_000,
  maxRetries: 3,
  retryDelayMs: 1_000,
})

Environment Variables#

For zero-config framework setups (Next.js, Remix, Astro), define:

# Required
ICBUCKET_ID=my-storage-bucket
ICBUCKET_API_KEY=icp_live_sec_100234

# Optional overrides
ICBUCKET_CDN_BASE=https://cloud.icpay.app
ICBUCKET_CANISTER_ID=6vbhm-nqaaa-aaaan-q6muq-cai

Verification#

Verify client connectivity with a ping call:

const isHealthy = await bucket.ping()
console.log("Canister connection:", isHealthy ? "OK" : "FAILED")

Related Pages#

  • Authentication
  • Basic Usage
  • Best Practices
PreviousInstallationNextAuthentication
Edit this page on GitLabUpdated recently

On this page

PrerequisitesStepsClient OptionsEnvironment VariablesVerificationRelated Pages

Search documentation

Quickly find guides, APIs, and reference docs