Use our API and components to handle embedding, storing, and streaming video in your Node application
Add a dependency on the @mux/mux-node
package via npm or yarn.
npm install @mux/mux-node
To start, you'll need a Mux access token. Once you've got that, you're off to the races!
import Mux from '@mux/mux-node';
const mux = new Mux({
tokenId: process.env.MUX_TOKEN_ID,
tokenSecret: process.env.MUX_TOKEN_SECRET
});
const asset = await mux.video.assets.create({
input: [{ url: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4' }],
playback_policy: ['public'],
});
Check out the Mux Node SDK docs for more information.