### Install from git Source: https://github.com/muxinc/mux-ts/blob/main/CONTRIBUTING.md Install the repository directly from git using npm. ```sh $ npm install git+ssh://git@github.com:muxinc/mux-ts.git ``` -------------------------------- ### Install @mux/ts with npm Source: https://github.com/muxinc/mux-ts/blob/main/README.md Install the @mux/ts SDK via npm. ```sh npm install @mux/ts ``` -------------------------------- ### Run an example Source: https://github.com/muxinc/mux-ts/blob/main/CONTRIBUTING.md Make the example executable and run it against your API using the tsn script. ```sh $ chmod +x examples/.ts # run the example against your api $ yarn tsn -T examples/.ts ``` -------------------------------- ### Install dependencies and build Source: https://github.com/muxinc/mux-ts/blob/main/CONTRIBUTING.md Run these commands to install all required dependencies and build output files to the dist/ directory. ```sh $ yarn $ yarn build ``` -------------------------------- ### Install dependencies and run locally Source: https://github.com/muxinc/mux-ts/blob/main/packages/mcp-server/cloudflare-worker/README.md Commands to install dependencies and run the server locally for development. ```bash # install dependencies npm install # run locally npm run dev ``` -------------------------------- ### GET /video/v1/drm-configurations Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Lists DRM configurations. ```APIDOC ## GET /video/v1/drm-configurations ### Description Lists DRM configurations. ### Method GET ### Endpoint /video/v1/drm-configurations ### Parameters #### Query Parameters - **params** (object) - Optional - Query parameters for the list request. ### Response #### Success Response (200) - **DRMConfigurationsBasePage** - The page of DRM configurations. ### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### GET /video/v1/assets Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Lists assets. ```APIDOC ## GET /video/v1/assets ### Description Lists assets. ### Method GET ### Endpoint /video/v1/assets ### Parameters #### Query Parameters - **params** (object) - Optional - List parameters. ### Response #### Success Response (200) - **AssetsCursorPage** (object) - A cursor page of assets. #### Response Example ```json { "data": [], "has_more": false } ``` ``` -------------------------------- ### Start mock server Source: https://github.com/muxinc/mux-ts/blob/main/CONTRIBUTING.md Run the mock server script, which is required before running most tests. ```sh $ ./scripts/mock ``` -------------------------------- ### GET /data/v1/monitoring/metrics Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Lists all monitoring metrics. ```APIDOC ## GET /data/v1/monitoring/metrics ### Description Lists all monitoring metrics. ### Method GET ### Endpoint /data/v1/monitoring/metrics ### Response #### Success Response (200) - **MetricListResponse** - The response containing the list of monitoring metrics. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### package.json for Bun Source: https://github.com/muxinc/mux-ts/blob/main/MIGRATION.md Install @types/bun version 1.2.0 or higher as a dev dependency. ```json { "devDependencies": { "@types/bun": ">= 1.2.0" } } ``` -------------------------------- ### GET /{PLAYBACK_ID}/storyboard.{EXTENSION} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Generates a storyboard image for a playback. ```APIDOC ## GET /{PLAYBACK_ID}/storyboard.{EXTENSION} ### Description Generates a storyboard image for a playback. ### Method GET ### Endpoint /{PLAYBACK_ID}/storyboard.{EXTENSION} ### Parameters #### Path Parameters - **playbackId** (string) - Required - The playback ID. - **extension** (string) - Required - The image extension (e.g., jpg). #### Query Parameters - **params** (object) - Optional - Query parameters for the storyboard request. ### Response #### Success Response (200) - **Response** - The storyboard image response. ### Response Example ```json { "image": "binary" } ``` ``` -------------------------------- ### GET /video/v1/uploads Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Lists uploads. ```APIDOC ## GET /video/v1/uploads ### Description Lists uploads. ### Method GET ### Endpoint /video/v1/uploads ### Parameters #### Query Parameters - **params** (object) - Optional - Query parameters for listing uploads. ### Response #### Success Response (200) - **UploadsBasePage** - A page of uploads. ``` -------------------------------- ### GET /system/v1/signing-keys Source: https://github.com/muxinc/mux-ts/blob/main/api.md Lists all signing keys. Returns a paginated list of SigningKey objects. ```APIDOC ## GET /system/v1/signing-keys ### Description Lists all signing keys. ### Method GET ### Endpoint /system/v1/signing-keys ### Parameters #### Query Parameters - **limit** (number) - Optional - Maximum number of items to return. - **page** (number) - Optional - Page number for pagination. ### Response #### Success Response (200) - **SigningKeysBasePage** - A paginated list of signing keys. #### Response Example { "data": [ { "id": "string", "created_at": "string" } ], "total": 0, "page": 1, "limit": 25 } ``` -------------------------------- ### GET /video/v1/transcription-vocabularies Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Lists transcription vocabularies. ```APIDOC ## GET /video/v1/transcription-vocabularies ### Description Lists transcription vocabularies. ### Method GET ### Endpoint /video/v1/transcription-vocabularies ### Parameters #### Query Parameters - **params** (object) - Optional - Query parameters for listing transcription vocabularies. ### Response #### Success Response (200) - **TranscriptionVocabulariesBasePage** - A page of transcription vocabularies. ``` -------------------------------- ### GET /video/v1/live-streams Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Lists all live streams for the account. ```APIDOC ## GET /video/v1/live-streams ### Description Lists all live streams for the account. ### Method GET ### Endpoint /video/v1/live-streams ### Parameters #### Query Parameters - **params** (object) - Optional - Query parameters for filtering and pagination. ### Response #### Success Response (200) - **LiveStreamsBasePage** - A page of live streams. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### GET /{PLAYBACK_ID}/storyboard.vtt Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves the storyboard VTT file for a playback. ```APIDOC ## GET /{PLAYBACK_ID}/storyboard.vtt ### Description Retrieves the storyboard VTT file for a playback. ### Method GET ### Endpoint /{PLAYBACK_ID}/storyboard.vtt ### Parameters #### Path Parameters - **playbackId** (string) - Required - The playback ID. #### Query Parameters - **params** (object) - Optional - Query parameters for the storyboard VTT request. ### Response #### Success Response (200) - **string** - The storyboard VTT content. ### Response Example ```json { "vtt": "string" } ``` ``` -------------------------------- ### GET /system/v1/webhooks Source: https://github.com/muxinc/mux-ts/blob/main/api.md Lists all webhooks. Returns a paginated list of Webhook objects. ```APIDOC ## GET /system/v1/webhooks ### Description Lists all webhooks. ### Method GET ### Endpoint /system/v1/webhooks ### Parameters #### Query Parameters - **limit** (number) - Optional - Maximum number of items to return. - **page** (number) - Optional - Page number for pagination. ### Response #### Success Response (200) - **WebhooksBasePage** - A paginated list of webhooks. #### Response Example { "data": [ { "id": "string", "url": "https://example.com/webhook", "events": ["video.asset.created"], "created_at": "string" } ], "total": 0, "page": 1, "limit": 25 } ``` -------------------------------- ### GET /{PLAYBACK_ID}/thumbnail.{EXTENSION} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Generates a thumbnail image for a playback. ```APIDOC ## GET /{PLAYBACK_ID}/thumbnail.{EXTENSION} ### Description Generates a thumbnail image for a playback. ### Method GET ### Endpoint /{PLAYBACK_ID}/thumbnail.{EXTENSION} ### Parameters #### Path Parameters - **playbackId** (string) - Required - The playback ID. - **extension** (string) - Required - The image extension (e.g., png, jpg). #### Query Parameters - **params** (object) - Optional - Query parameters for the thumbnail request. ### Response #### Success Response (200) - **Response** - The thumbnail image response. ### Response Example ```json { "image": "binary" } ``` ``` -------------------------------- ### GET /video/v1/drm-configurations/{DRM_CONFIGURATION_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves a specific DRM configuration by ID. ```APIDOC ## GET /video/v1/drm-configurations/{DRM_CONFIGURATION_ID} ### Description Retrieves a specific DRM configuration by ID. ### Method GET ### Endpoint /video/v1/drm-configurations/{DRM_CONFIGURATION_ID} ### Parameters #### Path Parameters - **drmConfigurationID** (string) - Required - The ID of the DRM configuration. ### Response #### Success Response (200) - **DRMConfiguration** - The DRM configuration object. ### Response Example ```json { "id": "string" } ``` ``` -------------------------------- ### GET /video/v1/delivery-usage Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Lists delivery usage reports for the account. ```APIDOC ## GET /video/v1/delivery-usage ### Description Retrieves delivery usage data for the account. ### Method GET ### Endpoint /video/v1/delivery-usage ### Parameters #### Query Parameters - **params** (object) - Optional - Query parameters for filtering and pagination. ### Response #### Success Response (200) - **DeliveryReportsPageWithTimeframe** - A page of delivery reports with timeframe information. #### Response Example ```json { "data": [], "timeframe": [] } ``` ``` -------------------------------- ### GET /system/v1/usage/exports Source: https://github.com/muxinc/mux-ts/blob/main/api.md Lists usage exports. Returns a UsageExportsResponse object. ```APIDOC ## GET /system/v1/usage/exports ### Description Lists usage exports. ### Method GET ### Endpoint /system/v1/usage/exports ### Parameters #### Query Parameters - **date** (string) - Optional - The date for which to retrieve usage exports. - **page** (number) - Optional - Page number for pagination. - **limit** (number) - Optional - Maximum number of items to return. ### Response #### Success Response (200) - **UsageExportsResponse** - A list of usage exports. #### Response Example { "data": [ { "id": "string", "created_at": "string", "url": "string" } ], "meta": { "total": 0 } } ``` -------------------------------- ### GET /system/v1/whoami Source: https://github.com/muxinc/mux-ts/blob/main/api.md Returns information about the current authenticated user or application. ```APIDOC ## GET /system/v1/whoami ### Description Returns information about the current authenticated user or application. ### Method GET ### Endpoint /system/v1/whoami ### Response #### Success Response (200) - **UtilityWhoamiResponse** - Information about the current user. #### Response Example { "account_id": "string", "token_id": "string" } ``` -------------------------------- ### GET /video/v1/assets/{ASSET_ID}/input-info Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves input information for an asset. ```APIDOC ## GET /video/v1/assets/{ASSET_ID}/input-info ### Description Retrieves input information for an asset. ### Method GET ### Endpoint /video/v1/assets/{ASSET_ID}/input-info ### Parameters #### Path Parameters - **ASSET_ID** (string) - Required - The asset ID. ### Response #### Success Response (200) - **AssetRetrieveInputInfoResponse** (object) - The input information. #### Response Example ```json { "input": {} } ``` ``` -------------------------------- ### GET /video/v1/assets/{ASSET_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves an asset by its ID. ```APIDOC ## GET /video/v1/assets/{ASSET_ID} ### Description Retrieves an asset by its ID. ### Method GET ### Endpoint /video/v1/assets/{ASSET_ID} ### Parameters #### Path Parameters - **ASSET_ID** (string) - Required - The asset ID. ### Response #### Success Response (200) - **Asset** (object) - The retrieved asset. #### Response Example ```json { "id": "string", "status": "ready" } ``` ``` -------------------------------- ### GET /{PLAYBACK_ID}/{FILENAME} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves a static rendition file for a playback. ```APIDOC ## GET /{PLAYBACK_ID}/{FILENAME} ### Description Retrieves a static rendition file for a playback. ### Method GET ### Endpoint /{PLAYBACK_ID}/{FILENAME} ### Parameters #### Path Parameters - **playbackId** (string) - Required - The playback ID. - **filename** (string) - Required - The filename of the static rendition. #### Query Parameters - **params** (object) - Optional - Query parameters for the static rendition request. ### Response #### Success Response (200) - **Response** - The static rendition file response. ### Response Example ```json { "file": "binary" } ``` ``` -------------------------------- ### GET /{PLAYBACK_ID}/animated.{EXTENSION} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Generates an animated thumbnail (GIF) for a playback. ```APIDOC ## GET /{PLAYBACK_ID}/animated.{EXTENSION} ### Description Generates an animated thumbnail (GIF) for a playback. ### Method GET ### Endpoint /{PLAYBACK_ID}/animated.{EXTENSION} ### Parameters #### Path Parameters - **playbackId** (string) - Required - The playback ID. - **extension** (string) - Required - The image extension (e.g., gif). #### Query Parameters - **params** (object) - Optional - Query parameters for the animated thumbnail request. ### Response #### Success Response (200) - **Response** - The animated thumbnail response. ### Response Example ```json { "image": "binary" } ``` ``` -------------------------------- ### GET /{PLAYBACK_ID}/storyboard.json Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves the storyboard metadata in JSON format for a playback. ```APIDOC ## GET /{PLAYBACK_ID}/storyboard.json ### Description Retrieves the storyboard metadata in JSON format for a playback. ### Method GET ### Endpoint /{PLAYBACK_ID}/storyboard.json ### Parameters #### Path Parameters - **playbackId** (string) - Required - The playback ID. #### Query Parameters - **params** (object) - Optional - Query parameters for the storyboard metadata request. ### Response #### Success Response (200) - **string** - The storyboard metadata JSON content. ### Response Example ```json { "json": "string" } ``` ``` -------------------------------- ### package.json for Node.js Source: https://github.com/muxinc/mux-ts/blob/main/MIGRATION.md Install @types/node version 20 or higher as a dev dependency for Node.js type support. ```json { "devDependencies": { "@types/node": ">= 20" } } ``` -------------------------------- ### GET /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/timeseries Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets timeseries for a specific monitoring metric. ```APIDOC ## GET /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/timeseries ### Description Gets timeseries for a specific monitoring metric. ### Method GET ### Endpoint /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/timeseries ### Parameters #### Path Parameters - **MONITORING_METRIC_ID** (string) - Required - The ID of the monitoring metric. #### Query Parameters - **params** (object) - Optional - Additional query parameters. ### Response #### Success Response (200) - **MetricGetTimeseriesResponse** - The response containing the timeseries data. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### GET /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves a specific simulcast target for a live stream. ```APIDOC ## GET /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} ### Description Retrieves a specific simulcast target for a live stream. ### Method GET ### Endpoint /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} ### Parameters #### Path Parameters - **LIVE_STREAM_ID** (string) - Required - The ID of the live stream. - **SIMULCAST_TARGET_ID** (string) - Required - The ID of the simulcast target to retrieve. ### Response #### Success Response (200) - **SimulcastTarget** - The requested simulcast target object. #### Response Example ```json { "id": "string" } ``` ``` -------------------------------- ### GET /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/breakdown Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets breakdown for a specific monitoring metric. ```APIDOC ## GET /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/breakdown ### Description Gets breakdown for a specific monitoring metric. ### Method GET ### Endpoint /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/breakdown ### Parameters #### Path Parameters - **MONITORING_METRIC_ID** (string) - Required - The ID of the monitoring metric. #### Query Parameters - **params** (object) - Optional - Additional query parameters. ### Response #### Success Response (200) - **MetricGetBreakdownResponse** - The response containing the breakdown data. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### GET /data/v1/monitoring/metrics/{MONITORING_HISTOGRAM_METRIC_ID}/histogram-timeseries Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets histogram timeseries for a specific monitoring metric. ```APIDOC ## GET /data/v1/monitoring/metrics/{MONITORING_HISTOGRAM_METRIC_ID}/histogram-timeseries ### Description Gets histogram timeseries for a specific monitoring metric. ### Method GET ### Endpoint /data/v1/monitoring/metrics/{MONITORING_HISTOGRAM_METRIC_ID}/histogram-timeseries ### Parameters #### Path Parameters - **MONITORING_HISTOGRAM_METRIC_ID** (string) - Required - The ID of the monitoring histogram metric. #### Query Parameters - **params** (object) - Optional - Additional query parameters. ### Response #### Success Response (200) - **MetricGetHistogramTimeseriesResponse** - The response containing the histogram timeseries data. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### GET /data/v1/metrics/comparison Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Lists all metric values for comparison. This method is used to retrieve comparison data for metrics. ```APIDOC ## GET /data/v1/metrics/comparison ### Description Lists all metric values for comparison. This method is used to retrieve comparison data for metrics. ### Method GET ### Endpoint /data/v1/metrics/comparison ### Parameters #### Query Parameters - **params** (object) - Optional - Additional query parameters for filtering and pagination. ### Request Example {} ### Response #### Success Response (200) - **data** (AllMetricValuesResponse) - The response containing metric values. #### Response Example { "data": {} } ``` -------------------------------- ### GET /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/breakdown-timeseries Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets breakdown timeseries for a specific monitoring metric. ```APIDOC ## GET /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/breakdown-timeseries ### Description Gets breakdown timeseries for a specific monitoring metric. ### Method GET ### Endpoint /data/v1/monitoring/metrics/{MONITORING_METRIC_ID}/breakdown-timeseries ### Parameters #### Path Parameters - **MONITORING_METRIC_ID** (string) - Required - The ID of the monitoring metric. #### Query Parameters - **params** (object) - Optional - Additional query parameters. ### Response #### Success Response (200) - **MetricGetBreakdownTimeseriesResponse** - The response containing the breakdown timeseries data. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### Add an example file Source: https://github.com/muxinc/mux-ts/blob/main/CONTRIBUTING.md Create a new TypeScript file in the examples/ directory. The shebang line enables running it with npm run tsn. ```ts // add an example to examples/.ts #!/usr/bin/env -S npm run tsn -T … ``` -------------------------------- ### Configure proxy in Deno with Deno.createHttpClient Source: https://github.com/muxinc/mux-ts/blob/main/README.md Configure a proxy in Deno by creating an HTTP client with Deno.createHttpClient and passing it via fetchOptions.client. Note the import uses 'npm:@mux/ts'. ```ts import Mux from 'npm:@mux/ts'; const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } }); const client = new Mux({ fetchOptions: { client: httpClient, }, }); ``` -------------------------------- ### Resource classes: before and after Source: https://github.com/muxinc/mux-ts/blob/main/MIGRATION.md Shows the change from importing Video directly to using the Mux class or importing from the resource file. ```typescript // Before const { Video } = require('@mux/mux-node'); // After const { Mux } = require('@mux/mux-node'); Mux.Video; // or import directly from @mux/mux-node/resources/video/video ``` -------------------------------- ### GET /data/v1/metrics/{METRIC_ID}/insights Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets insights for a specific metric. This method is used to retrieve insights data for a metric. ```APIDOC ## GET /data/v1/metrics/{METRIC_ID}/insights ### Description Gets insights for a specific metric. This method is used to retrieve insights data for a metric. ### Method GET ### Endpoint /data/v1/metrics/{METRIC_ID}/insights ### Parameters #### Path Parameters - **metricID** (string) - Required - The ID of the metric. #### Query Parameters - **params** (object) - Optional - Additional query parameters for filtering and pagination. ### Request Example {} ### Response #### Success Response (200) - **data** (InsightsResponse) - The response containing insights. #### Response Example { "data": {} } ``` -------------------------------- ### Configure proxy in Bun with fetchOptions.proxy Source: https://github.com/muxinc/mux-ts/blob/main/README.md Configure a proxy in Bun by setting the proxy option in fetchOptions. ```ts import Mux from '@mux/ts'; const client = new Mux({ fetchOptions: { proxy: 'http://localhost:8888', }, }); ``` -------------------------------- ### POST /video/v1/assets/{ASSET_ID}/static-renditions Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Creates a static rendition for an asset. ```APIDOC ## POST /video/v1/assets/{ASSET_ID}/static-renditions ### Description Creates a static rendition for an asset. ### Method POST ### Endpoint /video/v1/assets/{ASSET_ID}/static-renditions ### Parameters #### Path Parameters - **ASSET_ID** (string) - Required - The asset ID. #### Request Body - **params** (object) - Required - Static rendition creation parameters. ### Response #### Success Response (200) - **StaticRendition** (object) - The created static rendition. #### Response Example ```json { "id": "string", "status": "ready" } ``` ``` -------------------------------- ### GET /data/v1/metrics/{METRIC_ID}/timeseries Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets timeseries data for a specific metric. This method is used to retrieve timeseries data for a metric. ```APIDOC ## GET /data/v1/metrics/{METRIC_ID}/timeseries ### Description Gets timeseries data for a specific metric. This method is used to retrieve timeseries data for a metric. ### Method GET ### Endpoint /data/v1/metrics/{METRIC_ID}/timeseries ### Parameters #### Path Parameters - **metricID** (string) - Required - The ID of the metric. #### Query Parameters - **params** (object) - Optional - Additional query parameters for filtering and pagination. ### Request Example {} ### Response #### Success Response (200) - **data** (MetricTimeseriesDataResponse) - The response containing timeseries data. #### Response Example { "data": {} } ``` -------------------------------- ### GET /data/v1/metrics/{METRIC_ID}/overall Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets overall values for a specific metric. This method is used to retrieve overall metric values. ```APIDOC ## GET /data/v1/metrics/{METRIC_ID}/overall ### Description Gets overall values for a specific metric. This method is used to retrieve overall metric values. ### Method GET ### Endpoint /data/v1/metrics/{METRIC_ID}/overall ### Parameters #### Path Parameters - **metricID** (string) - Required - The ID of the metric. #### Query Parameters - **params** (object) - Optional - Additional query parameters for filtering and pagination. ### Request Example {} ### Response #### Success Response (200) - **data** (OverallValuesResponse) - The response containing overall values. #### Response Example { "data": {} } ``` -------------------------------- ### POST /system/v1/signing-keys Source: https://github.com/muxinc/mux-ts/blob/main/api.md Creates a new signing key. Returns the created SigningKey object. ```APIDOC ## POST /system/v1/signing-keys ### Description Creates a new signing key. ### Method POST ### Endpoint /system/v1/signing-keys ### Response #### Success Response (200) - **SigningKey** - The created signing key. #### Response Example { "id": "string", "created_at": "string", "private_key": "string" } ``` -------------------------------- ### GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/overall Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets overall values for a specific subview metric. This method is used to retrieve overall values for a subview metric. ```APIDOC ## GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/overall ### Description Gets overall values for a specific subview metric. This method is used to retrieve overall values for a subview metric. ### Method GET ### Endpoint /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/overall ### Parameters #### Path Parameters - **metricID** (string) - Required - The ID of the metric. - **subviewType** (string) - Required - The type of subview. #### Query Parameters - **params** (object) - Optional - Additional query parameters for filtering and pagination. ### Request Example {} ### Response #### Success Response (200) - **data** (SubviewOverallValuesResponse) - The response containing overall values. #### Response Example { "data": {} } ``` -------------------------------- ### GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/breakdown-timeseries Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Gets breakdown timeseries data for a specific subview metric. This method is used to retrieve breakdown timeseries data for a subview metric. ```APIDOC ## GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/breakdown-timeseries ### Description Gets breakdown timeseries data for a specific subview metric. This method is used to retrieve breakdown timeseries data for a subview metric. ### Method GET ### Endpoint /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/breakdown-timeseries ### Parameters #### Path Parameters - **metricID** (string) - Required - The ID of the metric. - **subviewType** (string) - Required - The type of subview. #### Query Parameters - **params** (object) - Optional - Additional query parameters for filtering and pagination. ### Request Example {} ### Response #### Success Response (200) - **data** (SubviewBreakdownTimeseriesResponse) - The response containing breakdown timeseries data. #### Response Example { "data": {} } ``` -------------------------------- ### POST /video/v1/assets Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Creates a new asset. ```APIDOC ## POST /video/v1/assets ### Description Creates a new asset. ### Method POST ### Endpoint /video/v1/assets ### Parameters #### Request Body - **params** (object) - Required - Asset creation parameters. ### Response #### Success Response (200) - **Asset** (object) - The created asset. #### Response Example ```json { "id": "string", "status": "preparing" } ``` ``` -------------------------------- ### Create a video asset with @mux/ts Source: https://github.com/muxinc/mux-ts/blob/main/README.md Create a Mux client and create a video asset. The tokenId and tokenSecret default to environment variables MUX_TOKEN_ID and MUX_TOKEN_SECRET, so they can be omitted if those are set. ```js import Mux from '@mux/ts'; const client = new Mux({ tokenId: process.env['MUX_TOKEN_ID'], // This is the default and can be omitted tokenSecret: process.env['MUX_TOKEN_SECRET'], // This is the default and can be omitted }); const asset = await client.video.assets.create({ inputs: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }], playback_policies: ['public'], }); console.log(asset.id); ``` -------------------------------- ### PUT /video/v1/live-streams/{LIVE_STREAM_ID}/enable Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Enables a live stream. ```APIDOC ## PUT /video/v1/live-streams/{LIVE_STREAM_ID}/enable ### Description Enables a live stream. ### Method PUT ### Endpoint /video/v1/live-streams/{LIVE_STREAM_ID}/enable ### Parameters #### Path Parameters - **LIVE_STREAM_ID** (string) - Required - The ID of the live stream. ### Response #### Success Response (200) - **void** - No content. #### Response Example ```json {} ``` -------------------------------- ### GET /data/v1/monitoring/dimensions Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Lists all monitoring dimensions. ```APIDOC ## GET /data/v1/monitoring/dimensions ### Description Lists all monitoring dimensions. ### Method GET ### Endpoint /data/v1/monitoring/dimensions ### Response #### Success Response (200) - **MonitoringListDimensionsResponse** - The response containing the list of monitoring dimensions. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### Configure Mux MCP Server in Client Configuration JSON Source: https://github.com/muxinc/mux-ts/blob/main/packages/mcp-server/README.md Example configuration for MCP clients that use a JSON configuration file. Sets the command, arguments, and required environment variables for the Mux MCP server. ```json { "mcpServers": { "mux": { "command": "npx", "args": ["-y", "@mux/mcp"], "env": { "MUX_TOKEN_ID": "my token id", "MUX_TOKEN_SECRET": "my secret", "MUX_WEBHOOK_SECRET": "My Webhook Secret", "MUX_SIGNING_KEY": "My Jwt Signing Key", "MUX_PRIVATE_KEY": "My Jwt Private Key", "MUX_AUTHORIZATION_TOKEN": "my authorization token" } } } } ``` -------------------------------- ### Run tests Source: https://github.com/muxinc/mux-ts/blob/main/CONTRIBUTING.md Execute the test suite after the mock server is running. ```sh $ yarn run test ``` -------------------------------- ### GET /video/v1/playback-restrictions Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Lists playback restrictions. ```APIDOC ## GET /video/v1/playback-restrictions ### Description Lists playback restrictions. ### Method GET ### Endpoint /video/v1/playback-restrictions ### Parameters #### Query Parameters - **params** (object) - Optional - Parameters for listing playback restrictions. ### Response #### Success Response (200) - **PlaybackRestrictionsBasePage** - A page of playback restrictions. ``` -------------------------------- ### GET /video/v1/uploads/{UPLOAD_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves an upload by its ID. ```APIDOC ## GET /video/v1/uploads/{UPLOAD_ID} ### Description Retrieves an upload by its ID. ### Method GET ### Endpoint /video/v1/uploads/{UPLOAD_ID} ### Parameters #### Path Parameters - **UPLOAD_ID** (string) - Required - The ID of the upload to retrieve. ### Response #### Success Response (200) - **Upload** - The upload object. ``` -------------------------------- ### Set fetchOptions on Mux client Source: https://github.com/muxinc/mux-ts/blob/main/README.md Set custom fetch options (RequestInit) when instantiating the client. Request-specific options override client options. ```ts import Mux from '@mux/ts'; const client = new Mux({ fetchOptions: { // `RequestInit` options }, }); ``` -------------------------------- ### POST /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Creates a simulcast target for a live stream. ```APIDOC ## POST /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets ### Description Creates a simulcast target for a live stream. ### Method POST ### Endpoint /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets ### Parameters #### Path Parameters - **LIVE_STREAM_ID** (string) - Required - The ID of the live stream. #### Request Body - **params** (object) - Required - Simulcast target configuration. ### Response #### Success Response (200) - **SimulcastTarget** - The created simulcast target object. #### Response Example ```json { "id": "string" } ``` ``` -------------------------------- ### GET /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves a playback restriction. ```APIDOC ## GET /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID} ### Description Retrieves a playback restriction. ### Method GET ### Endpoint /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID} ### Parameters #### Path Parameters - **PLAYBACK_RESTRICTION_ID** (string) - Required - The ID of the playback restriction to retrieve. ### Response #### Success Response (200) - **PlaybackRestriction** - The playback restriction details. ``` -------------------------------- ### GET /video/v1/playback-ids/{PLAYBACK_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves a playback ID. ```APIDOC ## GET /video/v1/playback-ids/{PLAYBACK_ID} ### Description Retrieves a playback ID. ### Method GET ### Endpoint /video/v1/playback-ids/{PLAYBACK_ID} ### Parameters #### Path Parameters - **PLAYBACK_ID** (string) - Required - The playback ID to retrieve. ### Response #### Success Response (200) - **PlaybackIdsRetrieveResponse** - The playback ID details. ``` -------------------------------- ### POST /system/v1/webhooks Source: https://github.com/muxinc/mux-ts/blob/main/api.md Creates a new webhook. Returns the created Webhook object. ```APIDOC ## POST /system/v1/webhooks ### Description Creates a new webhook. ### Method POST ### Endpoint /system/v1/webhooks ### Parameters #### Request Body - **url** (string) - Required - The URL to send webhook events to. - **events** (array of strings) - Required - The list of event types to subscribe to. ### Request Example { "url": "https://example.com/webhook", "events": ["video.asset.created"] } ### Response #### Success Response (200) - **Webhook** - The created webhook. #### Response Example { "id": "string", "url": "https://example.com/webhook", "events": ["video.asset.created"], "created_at": "string" } ``` -------------------------------- ### MCP Server Configuration JSON Source: https://github.com/muxinc/mux-ts/blob/main/packages/mcp-server/README.md Example configuration for an MCP server hosted at http://localhost:3000, including an Authorization header. ```json { "mcpServers": { "mux": { "url": "http://localhost:3000", "headers": { "Authorization": "Basic " } } } } ``` -------------------------------- ### GET /data/v1/dimensions/{DIMENSION_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Lists values for a specific dimension. ```APIDOC ## GET /data/v1/dimensions/{DIMENSION_ID} ### Description Lists values for a specific dimension. ### Method GET ### Endpoint /data/v1/dimensions/{DIMENSION_ID} ### Parameters #### Path Parameters - **DIMENSION_ID** (string) - Required - The ID of the dimension. #### Query Parameters - **params** (object) - Optional - Additional query parameters. ### Response #### Success Response (200) - **DimensionValuesBasePage** - The response containing the dimension values. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### GET /data/v1/dimensions Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/data/api.md Lists all dimensions available in the Data API. ```APIDOC ## GET /data/v1/dimensions ### Description Lists all dimensions available in the Data API. ### Method GET ### Endpoint /data/v1/dimensions ### Response #### Success Response (200) - **DimensionsResponse** - The response containing the list of dimensions. #### Response Example ```json { "data": [] } ``` ``` -------------------------------- ### Run Mux MCP Server Directly with npx Source: https://github.com/muxinc/mux-ts/blob/main/packages/mcp-server/README.md Sets required environment variables and launches the Mux MCP server via npx. Use this for direct invocation without a client. ```sh export MUX_TOKEN_ID="my token id" export MUX_TOKEN_SECRET="my secret" export MUX_WEBHOOK_SECRET="My Webhook Secret" export MUX_SIGNING_KEY="My Jwt Signing Key" export MUX_PRIVATE_KEY="My Jwt Private Key" export MUX_AUTHORIZATION_TOKEN="my authorization token" npx -y @mux/mcp@latest ``` -------------------------------- ### POST /video/v1/live-streams Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Creates a new live stream. ```APIDOC ## POST /video/v1/live-streams ### Description Creates a new live stream. ### Method POST ### Endpoint /video/v1/live-streams ### Parameters #### Request Body - **params** (object) - Required - Live stream configuration parameters. ### Response #### Success Response (200) - **LiveStream** - The created live stream object. #### Response Example ```json { "id": "string", "stream_key": "string" } ``` ``` -------------------------------- ### GET /{PLAYBACK_ID}.m3u8 Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves the HLS playlist for a playback. ```APIDOC ## GET /{PLAYBACK_ID}.m3u8 ### Description Retrieves the HLS playlist for a playback. ### Method GET ### Endpoint /{PLAYBACK_ID}.m3u8 ### Parameters #### Path Parameters - **playbackId** (string) - Required - The playback ID. #### Query Parameters - **params** (object) - Optional - Query parameters for the HLS request. ### Response #### Success Response (200) - **Response** - The HLS playlist response. ### Response Example ```json { "playlist": "binary" } ``` ``` -------------------------------- ### GET /video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID} Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves a transcription vocabulary by its ID. ```APIDOC ## GET /video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID} ### Description Retrieves a transcription vocabulary by its ID. ### Method GET ### Endpoint /video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID} ### Parameters #### Path Parameters - **TRANSCRIPTION_VOCABULARY_ID** (string) - Required - The ID of the transcription vocabulary to retrieve. ### Response #### Success Response (200) - **TranscriptionVocabulary** - The transcription vocabulary object. ``` -------------------------------- ### Link local copy with yarn and pnpm Source: https://github.com/muxinc/mux-ts/blob/main/CONTRIBUTING.md Clone the repository and link it locally with either yarn or pnpm to use it from another package. ```sh # Clone $ git clone https://www.github.com/muxinc/mux-ts $ cd mux-ts # With yarn $ yarn link $ cd ../my-package $ yarn link @mux/ts # With pnpm $ pnpm link --global $ cd ../my-package $ pnpm link --global @mux/ts ``` -------------------------------- ### POST /video/v1/assets/{ASSET_ID}/tracks Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Creates a track for an asset. ```APIDOC ## POST /video/v1/assets/{ASSET_ID}/tracks ### Description Creates a track for an asset. ### Method POST ### Endpoint /video/v1/assets/{ASSET_ID}/tracks ### Parameters #### Path Parameters - **ASSET_ID** (string) - Required - The asset ID. #### Request Body - **params** (object) - Required - Track creation parameters. ### Response #### Success Response (200) - **Track** (object) - The created track. #### Response Example ```json { "id": "string", "type": "text" } ``` ``` -------------------------------- ### GET /video/v1/assets/{ASSET_ID}/shots Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Retrieves shots for an asset. ```APIDOC ## GET /video/v1/assets/{ASSET_ID}/shots ### Description Retrieves shots for an asset. ### Method GET ### Endpoint /video/v1/assets/{ASSET_ID}/shots ### Parameters #### Path Parameters - **ASSET_ID** (string) - Required - The asset ID. ### Response #### Success Response (200) - **AssetShots** (object) - The shots. #### Response Example ```json { "shots": [] } ``` ``` -------------------------------- ### PUT /video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Updates static rendition settings for new assets of a live stream. ```APIDOC ## PUT /video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions ### Description Updates static rendition settings for new assets of a live stream. ### Method PUT ### Endpoint /video/v1/live-streams/{LIVE_STREAM_ID}/new-asset-settings/static-renditions ### Parameters #### Path Parameters - **LIVE_STREAM_ID** (string) - Required - The ID of the live stream. #### Request Body - **params** (object) - Required - Static rendition settings. ### Response #### Success Response (200) - **LiveStream** - The updated live stream object. #### Response Example ```json { "id": "string", "stream_key": "string" } ``` ``` -------------------------------- ### GET /system/v1/webhooks/{WEBHOOK_ID} Source: https://github.com/muxinc/mux-ts/blob/main/api.md Retrieves a specific webhook by its ID. ```APIDOC ## GET /system/v1/webhooks/{WEBHOOK_ID} ### Description Retrieves a specific webhook by its ID. ### Method GET ### Endpoint /system/v1/webhooks/{WEBHOOK_ID} ### Parameters #### Path Parameters - **WEBHOOK_ID** (string) - Required - The ID of the webhook to retrieve. ### Response #### Success Response (200) - **Webhook** - The requested webhook. #### Response Example { "id": "string", "url": "https://example.com/webhook", "events": ["video.asset.created"], "created_at": "string" } ``` -------------------------------- ### PUT /video/v1/live-streams/{LIVE_STREAM_ID}/complete Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/video/api.md Marks a live stream as complete. ```APIDOC ## PUT /video/v1/live-streams/{LIVE_STREAM_ID}/complete ### Description Marks a live stream as complete. ### Method PUT ### Endpoint /video/v1/live-streams/{LIVE_STREAM_ID}/complete ### Parameters #### Path Parameters - **LIVE_STREAM_ID** (string) - Required - The ID of the live stream. ### Response #### Success Response (200) - **void** - No content. #### Response Example ```json {} ``` -------------------------------- ### POST /robots/v0/jobs/ask-questions Source: https://github.com/muxinc/mux-ts/blob/main/src/resources/robots/api.md Creates an ask-questions robot job. Returns the created job. ```APIDOC ## POST /robots/v0/jobs/ask-questions ### Description Creates an ask-questions robot job. ### Method POST ### Endpoint /robots/v0/jobs/ask-questions ### Parameters #### Request Body - **params** (object) - Required - Parameters for the ask-questions job. ### Response #### Success Response (200) - **AskQuestionsJob** - The created job. #### Response Example ```json { "id": "string", "type": "ask-questions" } ``` ```