Quickstart
Follow this page and you'll end up with a bucket, an image you can process in real time, your own domain with HTTPS, and a set of keys you can use in code. Each step links to detailed docs for when you need to go deeper.
| Step | Approximate time | What you get |
|---|---|---|
| 1. Sign up and verify your identity | 2 min | An account that can use the free tier |
| 2. Create a bucket and upload | 2 min | A file and its access link |
| 3. Process images in real time | 1 min | Images in different sizes and formats, with watermarks |
| 4. Create keys and connect your code | 3 min | A program that can read and write your bucket |
| 5. Deliver on your own domain | Depends on ICP filing and DNS | A CDN domain with an automatic certificate |
1. Sign up and verify your identity
Open the Bitiful console, sign up and sign in, then complete identity verification on the Account page. You need to be verified before you can create buckets and sub-users, and the free tier also starts after verification. See Sign up, sign in, and verification.
2. Create a bucket and upload
Create a bucket
Under Buckets in the sidebar, click Create bucket and enter a globally unique name, such as my-assets. You can adjust public read for each directory later.
See S4 quickstart and Upload files.
3. Process images in real time
Add parameters to an image link to get the processed result. The original file isn't modified. Here's a demo with a sample image:
| What you want | Link |
|---|---|
| Original image | demo.bitiful.com/girl.jpeg |
| 600 wide, in the smallest format the browser supports | ?w=600&fmt=auto |
| Cropped to 400×400, automatically keeping faces and the main subject | ?w=400&h=400&pos=smart |
| A text watermark | ?w=800&txt=Bitiful |
| One-click quality enhancement | ?w=800&enhance=70 |
You can also capture a frame from a video as its cover. For example, ?frame=auto&w=640 automatically picks a sharp, good-looking frame. Save parameter combinations you use often as a style and call them by a short name such as !style:thumb. For all parameters, see CoreIX overview.
Signed links to private files can carry processing parameters too. Just include the parameters when you generate the signature. See Presigned URLs.
4. Create keys and connect your code
Create a sub-user and AccessKey
Under Sub-users and keys in the sidebar, create a sub-user, then create an AccessKey for it. The SecretKey is shown only once, so save it right away.
Grant permissions
A new sub-user has no permissions. On the sub-user's permissions panel, grant it access to a bucket or a directory, choosing permissions such as read, write, and list. See Sub-user permissions.
import boto3
from botocore.config import Config
s3 = boto3.client(
"s3",
endpoint_url="https://s3.bitiful.net",
region_name="cn-east-1",
aws_access_key_id="<AccessKey>",
aws_secret_access_key="<SecretKey>",
config=Config(signature_version="s3v4", s3={"addressing_style": "virtual"}),
)
s3.upload_file("photo.jpg", "my-assets", "images/photo.jpg")
url = s3.generate_presigned_url(
"get_object", Params={"Bucket": "my-assets", "Key": "images/photo.jpg"}, ExpiresIn=600
)
print(url)import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
import { readFile } from "node:fs/promises";
const s3 = new S3Client({
endpoint: "https://s3.bitiful.net",
region: "cn-east-1",
credentials: { accessKeyId: "<AccessKey>", secretAccessKey: "<SecretKey>" },
});
await s3.send(new PutObjectCommand({
Bucket: "my-assets",
Key: "images/photo.jpg",
Body: await readFile("photo.jpg"),
}));aws configure set aws_access_key_id <AccessKey>
aws configure set aws_secret_access_key <SecretKey>
aws configure set region cn-east-1
aws --endpoint-url https://s3.bitiful.net s3 cp photo.jpg s3://my-assets/images/For more languages and complete examples, see SDK overview. Don't embed keys in web pages or apps. Instead, have your server issue presigned URLs so clients upload directly. See Upload files securely from the client.
If you'd rather not write code, you can manage files with the S4 Manager desktop client, or mount a bucket as a local disk with Bitifs.
5. Deliver on your own domain
Use the CDN to deliver files publicly. The bucket default domain has limits such as a single-thread speed limit and forced downloads. See Limits.
Add a CDN domain
Under CDN domains in the sidebar, click Add domain (see Manage CDN domains), enter a domain that has completed ICP filing, and choose the bucket you just created as the origin.
Configure the CNAME
At your DNS provider, add a CNAME record that points your domain to the address shown in the console.
Turn on HTTPS
Request an auto certificate in the Certificate Center. It renews automatically. After it's deployed, turn on HTTPS on the CDN domain's HTTPS tab.
Add rules as needed
On tabs such as Access control and Caching, use edge rules to set up hotlink protection, signed authentication, cache duration, and response headers.
See CDN quickstart, Edge rules, and Request auto certificates.