ShareStack logoShareStack

Launch your own instance

Host ShareStack on your own domain with your own brand and your own TikTok developer app. Nothing is shared. You own everything.

Setup guide

Prerequisites

  • A Cloudflare account (Workers + R2, both have free tiers).
  • A TikTok developer app (for the client key/secret and the audit).
  • A domain you control, proxied through Cloudflare.
  • bun installed locally, or npm.

Clone and install

git clone https://github.com/your-fork/sharestack.git
cd sharestack
bun install
cp sharestack.config.example.ts sharestack.config.ts

Rebrand the config

Open sharestack.config.ts and set brandName (must match your TikTok app name exactly),tagline, and the theme block. Use the theme generator below to produce the theme block interactively.

The brand icon at /icon.svg is generated automatically from your theme.accent color. To use a fully custom shape, edit src/views/brand-mark.tsx or point logoUrl/faviconUrl at your own asset.

Download icon (SVG) — convert to PNG and upload as your TikTok app icon.

Create your TikTok developer app

Go to developers.tiktok.com, create an app, and note your Client Key and Client Secret.

Set the redirect URI to:

https://YOUR_DOMAIN/api/auth/callback

Add your Privacy Policy URL (https://YOUR_DOMAIN/privacy) and Terms of Service URL (https://YOUR_DOMAIN/terms) in the app settings.

Request the scopes: user.info.basic, video.publish, video.upload, video.list.

Create R2 storage

In the Cloudflare dashboard, create an R2 bucket (e.g. my-sharestack-videos). Attach a public custom domain (e.g. cdn.YOUR_DOMAIN) so TikTok can pull videos from it. Add a CORS rule that allows PUT requests from your app origin.

In your TikTok app, add https://cdn.YOUR_DOMAIN as a verified URL-prefix property. This is required for the PULL_FROM_URL upload method.

Configure wrangler.toml

Open wrangler.toml and set these vars:

[vars]
TIKTOK_CLIENT_KEY = "your_client_key"
PUBLIC_BASE_URL = "https://YOUR_DOMAIN"
STORAGE_ENDPOINT = "https://ACCOUNT_ID.r2.cloudflarestorage.com"
STORAGE_BUCKET = "my-sharestack-videos"
STORAGE_REGION = "auto"
STORAGE_PUBLIC_BASE_URL = "https://cdn.YOUR_DOMAIN"

Set secrets

Secrets are never committed. Set them once via Wrangler:

bunx wrangler secret put TIKTOK_CLIENT_SECRET
bunx wrangler secret put STORAGE_ACCESS_KEY_ID
bunx wrangler secret put STORAGE_SECRET_ACCESS_KEY

These persist on the Worker across deploys.

Deploy

bunx wrangler deploy

Then map your custom domain to the Worker in the Cloudflare dashboard.

For local development, copy .dev.vars.example to .dev.vars, fill in the secrets, and run bunx wrangler dev.

Submit for TikTok audit (or use Upload mode)

To use Direct Post (publish straight to a profile), submit your app for TikTok's Content Posting API review at the developer portal with a demo video covering each scope end-to-end.

Until approved, use Upload to inbox mode in the Studio to save videos as drafts in the TikTok app. No audit needed for Upload mode.


Theme generator

Pick a preset or tweak the palette, then copy the generated block into yoursharestack.config.ts.

Presets:

Backgrounds

Typography

Accents

States

Live preview

Your brand heading

Body text looks like this. Clear and readable at any size.

Muted caption or secondary label

Card surface with border. Tokens, metadata, or a form field live here.
Copied!

Paste this into the theme block of your sharestack.config.ts, then run bunx wrangler deploy.