OptStuff

Quick Start

Set up your OptStuff project and get your first optimized image in minutes.

This guide walks you through creating a project and obtaining your API keys. Once set up, you can jump straight into a framework integration.

1. Create a Team and Project

After signing in, you'll be guided to create your personal team:

  1. Enter a team name (a suggestion is pre-filled from your profile)
  2. Choose a team slug — the URL identifier (e.g., optstuff.com/my-team)
  3. Click Create Team

From the team dashboard, click Create Project and fill in:

  • Project Name (required)
  • Description (optional)
  • Image Sources — which domains host your original images (e.g., https://images.unsplash.com). Subdomains are included automatically.
  • Authorized Websites (optional) — which websites can display optimized images. Leave empty to allow all.

A default API key is generated automatically with your new project.

2. Copy Your Keys

After project creation, a success dialog displays your environment variables in .env format with a single copy button:

OPTSTUFF_BASE_URL="https://your-optstuff-deployment.com"
OPTSTUFF_PROJECT_SLUG="your-project-slug"
OPTSTUFF_PUBLIC_KEY="pk_abc123..."
OPTSTUFF_SECRET_KEY="sk_your_secret_key_here"
  • One-click copy — copies the full block, ready to paste into .env
  • Secret Key (sk_...) — shown masked in the preview, but copied as plaintext

Copy the secret key now. It is only shown once. The dialog is locked during this step — you cannot close it accidentally.

For key rotation and revocation, see Key Management.

3. Configure Image Sources

Go to your project's Settings → Domain Security → Image Sources and add the domains you want to optimize images from (e.g., https://images.unsplash.com). Without at least one allowed source domain, all image requests will be rejected in production.

See Domain Whitelisting for details.

(Optional) Verify Your Setup with the CLI

If you want to confirm your keys and configuration before integrating into your app, you can use the standalone CLI tool at examples/optstuff-url-signer:

Before running the example, make sure the Bun runtime is installed on your machine. This example does not require bun install; only the Bun runtime is needed to run bun run sign:url.

git clone https://github.com/EricTsai83/optstuff.git
cd optstuff/examples/optstuff-url-signer
cp .env.example .env   # paste your keys here
bun run sign:url

This prints a signed URL to your terminal. Paste it in a browser — if the image loads, your setup is working. For details on what the signing does, see URL Signing.

Next Steps

OptStuff is a standard HTTP API — any server-side language that can compute HMAC-SHA256 can generate signed URLs. See Code Examples for implementations in Python, Go, Ruby, and PHP.

Last updated on

On this page