---
name: bijection-mux
description: "Evaluate and integrate the Mux component with Bijection."
---

# Mux

Video assets, uploads and webhook synchronization

- Package: @bijectionhq/mux
- Category: Media
- Status: Preview
- License: Not specified
- Bijection source (repository access required): https://github.com/bijectionhq/mux/tree/cf453d509931cb1edc05b142ab7eac023bbc349b
- Upstream: https://github.com/muxinc/mux-convex-component/tree/76828f86f68c3416f6953ce5adba40e6cf92579a
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/mux

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/mux.git
cd mux
git checkout cf453d509931cb1edc05b142ab7eac023bbc349b
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes @mux/convex. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


> Agents: read this skill fully before writing code that uses Mux. Follow the installation and configuration steps exactly.

# Mux

## Instructions

The Mux Convex component synchronizes video data from Mux's video platform into your Convex database, providing real-time updates through webhooks and backfill operations. It creates tables for assets, uploads, live streams, and events, along with mutations and query helpers for managing video catalogs. The component handles the complex integration between Mux's API and Convex's reactive database, keeping your app's video state automatically synchronized.

### Installation

```bash
npm install @mux/convex
```

Current npm version: `@mux/convex@0.3.3`

## Use cases

- **Building a video-first application** where you need real-time updates when video processing completes, thumbnails are generated, or live streams change status
- **Creating a video content management system** that requires querying video assets by metadata like user ownership, titles, tags, or custom fields
- **Developing a video platform** where multiple users upload content and you need to track upload progress, processing status, and asset availability in real-time
- **Integrating Mux video into an existing Convex app** without manually managing webhook endpoints, database schema, or API synchronization logic
- **Building reactive video UIs** that automatically update when video assets change state, eliminating the need for polling Mux's API

## How it works

The component provides Convex tables that mirror Mux's data model, including `assets`, `uploads`, `liveStreams`, and `events`, plus a `videoMetadata` table for app-specific data like user ownership and custom fields. It includes mutations to upsert and delete synced Mux objects, along with query helpers for retrieving video catalog data.

Integration happens through two mechanisms: a one-time backfill operation via `migrations:backfillMux` that syncs existing Mux data, and webhook handling through generated routes that process real-time updates. The companion CLI package `@mux/convex-mux-init` scaffolds the necessary app-level Convex files including webhook handlers, HTTP routes, and migration functions.

The component follows Convex's architecture pattern where the component itself contains only the schema and database functions, while Node.js runtime code (Mux SDK calls, webhook verification) lives in generated app-level files. This separation allows the component to work within Convex's execution model while still integrating with Mux's Node.js SDK and webhook system.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by Mux is not needed

## Resources

- [npm package](https://www.npmjs.com/package/%40mux%2Fconvex)
- [GitHub repository](https://github.com/muxinc/mux-convex-component)
- [Live demo](https://github.com/muxinc/Mux-Convex-Example)
- [Convex Components Directory](https://www.convex.dev/components/mux/convex)
- [Convex documentation](https://docs.convex.dev)