Storage buckets
Create a bucket
Controls whether objects can be opened without authentication. Any value other than
private is treated as public.- Node.js
- Go
- Python
- Rust
Bucket operations
Objects
Upload an object
Per-object visibility. The SDK sends
public unless you pass private.file is a Blob. Rust can upload into a bucket with upload_asset and bucket_id. The Go and Python upload methods have no bucket field, so use the raw request method or S3 there.
Returns
Access keys
S3-compatible data access
Pxxl uses separate credentials for management and object data:- Use
PXXL_API_KEYto create buckets, issue or revoke access keys, and read analytics or billing. - Use the bucket-scoped
accessKeyIdand one-timesecretAccessKeyfor S3 object requests.
PXXL_API_KEY to the S3 endpoint. A storage access key is restricted to one bucket and has either read or read_write permission.
Create a Node.js S3 client
createS3Client() creates a key and returns a PxxlS3 client built from it. It throws if Pxxl did not return the secret.
The underlying AWS
S3Client is available as s3.client. pxxl.storage.s3(credentials) builds a PxxlS3 from credentials you already have.
Use stored credentials without a Pxxl API key
pathStyle defaults to true. The environment variable names here are only an example.
For Go, Python, and Rust, pass the returned endpoint, region, bucket, accessKeyId, secretAccessKey, and pathStyle fields to the standard AWS S3 client for that language. This works with AWS SDK for Go v2, boto3, and aws-sdk-s3.
Storage analytics
CDN assets
Upload an asset
Asset contents. Node.js takes a
Blob, Go an io.Reader, Python bytes, a file object, or file_path, and Rust bytes.- Node.js
- Go
- Python
- Rust
publicUrl for public files.
CDN operations
pxxl.assets is the same object as pxxl.cdn.
Other languages
The
PxxlS3 helper is in Node.js only.
