Buckets
ICBucket
ICPay Cloud guide
On-chain encrypted file storage
ICBucket
On-chain encrypted file storage
ICBucket
On-chain encrypted file storage
Guides
Configure client timeouts, automatic chunk retry strategies, Edge CDN domains, and environment settings.
The ICBucket client can be customized to match your infrastructure requirements, from serverless Next.js functions to long-running backup daemons.
icpay-bucket installed in your projectInitialize 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://cdn.icpay.app)
cdnBase: "https://cdn.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,
})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://cdn.icpay.app
ICBUCKET_CANISTER_ID=6vbhm-nqaaa-aaaan-q6muq-caiVerify client connectivity with a ping call:
const isHealthy = await bucket.ping()
console.log("Canister connection:", isHealthy ? "OK" : "FAILED")