Buckets
ICBucket
ICPay Cloud guide
On-chain encrypted file storage
ICBucket
On-chain encrypted file storage
ICBucket
On-chain encrypted file storage
Guides
Authenticate API requests using API keys, Internet Identity delegations, or agent principals.
ICBucket supports two primary authentication modes:
@dfinity/identity for direct in-browser client uploads.Generate a Read/Write or Read-Only API key from the ICPay dashboard:
import { ICBucket } from "icpay-bucket"
const bucket = new ICBucket({
bucketId: "my-assets",
apiKey: "icp_live_sec_f98234...",
})Pass the user's @dfinity/auth-client identity directly to the client:
import { ICBucket } from "icpay-bucket"
import { AuthClient } from "@dfinity/auth-client"
const authClient = await AuthClient.create()
const identity = authClient.getIdentity()
const bucket = new ICBucket({
bucketId: "my-assets",
identity, // User's on-chain principal
})Test that your credentials validate against the backend canister:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://cdn.icpay.app/cloud/my-assets/auth-test