Then you can trigger desktop replays programmatically like so.
constdashcam=require("dashcam");let replay =awaitdashcam.createReplay({ title:"My New Replay", description:`This **renders markdown** or plaintext in monospace font.`});
Catch Application Crashes
Then, call createReplay when your application crashes.
constdashcam=require("dashcam");process.on("uncaughtException",async (err) => {let replay =awaitdashcam.createReplay({ title:"uncaughtException", description: err, });console.log("Dashcam Clip", replay);});setTimeout(() => {thrownewError("Throw makes it go boom!");},3000);
Electron
const { dialog,shell } =require("electron");constoptions= { type:"question", buttons: ["Yes, please","No, thanks"], defaultId:0, title:"Error!", message:"You've encountered an error!", detail:"Would you like to send a replay to the dev team?",};let res =awaitdialog.showMessageBox(null, options, (response) => {console.log(response);});if (res) {shell.openExternal("replayable://replay/create");}