The first argument of .get() refers to the name of the variable we want to use, and the second assigns a default value if no variable is provided. Here, "new user" will be used if the username variable is not provided.
You can pass variables to renderVideo() as follows:
To use variables in the visual editor, you can pass them to makeProject in src/project.ts.
import {makeProject} from '@revideo/core';
import example from './scenes/example?scene';
export default makeProject({
scenes: [example],
variables: {username: 'Mike'},
});
Parameters allow you to customize videos extensively. For instance, you can also pass file names as parameters, which can in turn point to audio or images generated from AI services like text-to-speech software or image generators.
If you want to see an example project using more complex parameters in action, you can check out our . This project uses AI-generated images and subtitles, which are passed as a list of words along with timestamps.