Pitch your
own camp.
Everything runs on Cloudflare's free tier. Fork the repo, set a few variables, run one workflow — then connect your channels.
-
Cloudflare
Create the resources
One D1 database and two KV namespaces. Use the dashboard (Storage & Databases → D1 and KV) or the CLI, and note the three ids.
npx wrangler d1 create kervly-db npx wrangler kv namespace create kervly-oauth npx wrangler kv namespace create kervly-sessions
-
GitHub
Set secrets and variables
Fork the repository, then open Settings → Secrets and variables → Actions. Keeping ids out of the code means your fork carries nothing personal.
CLOUDFLARE_API_TOKENSecret · Workers Scripts, D1 and KV editCLOUDFLARE_ACCOUNT_IDSecret · from the dashboard homeD1_DATABASE_IDVariable · requiredKV_OAUTH_IDVariable · requiredKV_SESSIONS_IDVariable · requiredCUSTOM_DOMAINVariable · optional, zone on Cloudflare -
Deploy
Run the workflow
Actions → Deploy → Run workflow. Every later push to main redeploys automatically and applies database migrations.
✓ Typecheck and tests ✓ Render deployment config ✓ Database migrations ✓ Deploy
-
Admin
Password + 2FA
Open your Kervly URL — you're sent to
/setup. Choose a password of at least 12 characters and generate the values in your browser. Add them as Cloudflare secrets, then add the TOTP secret to your authenticator app.ADMIN_PASSWORD_HASHADMIN_TOTP_SECRETENCRYPTION_KEYCONSENT_SECRETIf ENCRYPTION_KEY changes, stored platform connections can't be decrypted and must be reconnected. -
Brands
Draw the allowlist
In the dashboard: Brands → New brand. Set an id, a name, the folders your videos are served from, a daily limit and a time zone. Kervly will only ever publish .mp4 files under these prefixes.
https://raw.githubusercontent.com/you/videos/main/clips/
-
Platforms
Create one app per platform
Each brand then connects its own accounts with Connect in the dashboard.
- Google Cloud Console: create a project and enable YouTube Data API v3.
- Google Auth Platform: audience External, scope
youtube.upload, add yourself as a test user, then publish the app to production. - Create a Web application client with redirect URI
<URL>/connect/youtube/callback. - Add Cloudflare secrets
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET. - Dashboard → select brand → YouTube → Connect.
In Testing mode refresh tokens expire after 7 days. Unverified projects may keep uploads private until you submit the free audit form.- Meta for Developers: create an app with Instagram API with Instagram Login.
- Add your Instagram account (as a tester if needed) and set the OAuth redirect URI to
<URL>/connect/instagram/callback. - Add Cloudflare secrets
INSTAGRAM_APP_IDandINSTAGRAM_APP_SECRET. - App settings → Basic: Privacy Policy
<URL>/privacy, Terms<URL>/terms. - Dashboard → select brand → Instagram → Connect.
Needs a professional (Business or Creator) account. In Development mode, publishing works for accounts with a role on the app.- TikTok for Developers: Manage apps → Connect an app; Web platform with your Terms and Privacy URLs.
- Add Login Kit and Content Posting API, and enable Direct Post.
- Redirect URI
<URL>/connect/tiktok/callback, scopesuser.info.basicandvideo.publish. - Submit for review, then add
TIKTOK_CLIENT_KEYandTIKTOK_CLIENT_SECRET. - Dashboard → select brand → TikTok → Connect.
Until the Content Posting API audit is approved, TikTok only allows private posts. Keep TIKTOK_UNAUDITED=true until then. -
MCP
Hand the reins to your agent
In Claude: Settings → Connectors → Add custom connector. Click Connect, sign in with password and 2FA, and click Allow.
https://<your-worker>.<subdomain>.workers.dev/mcp
“List my Kervly brands, then schedule https://…/clip.mp4 for YouTube and TikTok tomorrow at 10:00 Istanbul time.”
Full details, including every variable: SELF_HOSTING.md · Türkçe
When the road gets rough.
The platform’s client id or secret is missing. Add both as Cloudflare secrets.
The Google app is still in Testing. Publish it to production and reconnect.
Check whether the video appeared on the platform. If it didn’t, click Retry.
No. Adding a secret in Cloudflare creates a new worker version immediately.
Kervly Cloud does all of this for you.
No Cloudflare account, no GitHub workflow, no developer apps. Same open-source Kervly.