convex-mux-init
v0.1.5
Published
Scaffold app-level Convex wrappers for convex-mux-component.
Readme
convex-mux-init
Scaffold app-level Convex files for convex-mux-component.
Purpose
Convex component packages should stay component-only. App-specific Node wrappers for backfills and webhooks belong in the consuming app.
This CLI creates those app files for you:
convex/convex.config.tsconvex/migrations.tsconvex/muxWebhook.tsconvex/http.ts
Usage
Run in your app root (the folder that contains convex/):
npx convex-mux-initOptions:
npx convex-mux-init --component-name mux
npx convex-mux-init --force
npx convex-mux-init --skip-config
npx convex-mux-init --skip-http
npx convex-mux-init --skip-migration
npx convex-mux-init --skip-webhookNext Steps After Scaffolding
- Install Mux SDK in your app:
npm i @mux/mux-node- Set env vars in Convex:
npx convex env set MUX_TOKEN_ID <id>
npx convex env set MUX_TOKEN_SECRET <secret>
npx convex env set MUX_WEBHOOK_SECRET <secret>- Run:
npx convex dev
npx convex run migrations:backfillMux '{}'Video Metadata From Upload Flow
Generated webhook/backfill code can auto-upsert videoMetadata from Mux asset
passthrough.
- If
passthroughis a plain string, it is treated asuserId. - If
passthroughis JSON, it may include:userId(oruser_id),title,description,tags,visibility, andcustom.
Example:
{"userId":"user_123","title":"My clip","visibility":"public"}