Dashcam
HomeDashboard
  • Setup
    • đŸ–Ĩī¸Desktop App
    • 🌐Chrome Extension
    • âŒ¨ī¸CLI
    • 🐙GitHub Action
  • Manual Capture
    • đŸŽŦScreencast
    • âĒInstant Replay
    • 🐞Error Detection
  • Automated Test Recording
    • đŸĒŸWindows
  • Sharing
    • â˜‘ī¸Jira
    • 🐙GitHub
    • ⚡Zapier
    • đŸ’ŦSlack
  • đŸ•šī¸Configure
    • Display Selection
    • Storage
    • Logs
    • Other Settings
  • 💭FAQ
    • How Does Dashcam Work?
    • How can I tell what is recording and when?
    • Where are files saved on my machine?
    • How can I monitor Dashcam's internet activity?
    • How can I delete published clips?
    • Can I edit a published clip?
    • How long are published clips stored?
    • How can I share a clip?
    • How can I enable public links?
    • Is my screen being uploaded to the cloud in the background?
    • How do I update Dashcam?
    • I'm having problems streaming Netflix or Hulu
    • Archive
      • Piping to Files Directly
      • Log Files
      • đŸŽžī¸Trim
      • 😄Overview
      • Unity
      • Install the Chrome Extension
      • Install the CLI
      • Overview
      • Share
      • 😍Using the app
      • âš™ī¸Settings
      • 🧩Chromium
      • Live Demo!
      • Examples
      • Usage
      • Installation
      • GitHub Recipies
      • Embedding a Clip in a Readme
      • Embedding a playable clip in HTML
      • Embedding a Clip as GIF in HTML
      • Embedding a Clip as GIF in a Pull Request
      • đŸĒŖBitBucket
      • Add users to your team
      • 📂Your workspace
      • 🐙GitHub
      • ✅Jira Button
      • 🔧NodeJS
      • 🔗Web
        • Hotlinks
        • Javascript
      • đŸŽŦEditing a Dash
        • Creating a Dash
      • Uploading a Dash
      • đŸĒŸWindows Setup
      • 🍎Mac Setup
        • Install Dashcam on Mac
        • Enable Accessibility Features
      • Clip Expiration
      • đŸĨœNut.js
Powered by GitBook
On this page
  • Install
  • Create a Replay
  • Catch Application Crashes
  • Electron

Was this helpful?

  1. FAQ
  2. Archive

NodeJS

Install

First, install dashcam via npm.

npm install dashcam --save

Create a Replay

Then you can trigger desktop replays programmatically like so.

const dashcam = require("dashcam");

let replay = await dashcam.createReplay({
  title: "My New Replay",
  description: `This **renders markdown** or plaintext in monospace font.`
});

Catch Application Crashes

Then, call createReplay when your application crashes.

const dashcam = require("dashcam");

process.on("uncaughtException", async (err) => {
  let replay = await dashcam.createReplay({
    title: "uncaughtException",
    description: err,
  });
  console.log("Dashcam Clip", replay);
});

setTimeout(() => {
  throw new Error("Throw makes it go boom!");
}, 3000);

Electron

const { dialog, shell } = require("electron");

const options = {
  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 = await dialog.showMessageBox(null, options, (response) => {
  console.log(response);
});

if (res) {
  shell.openExternal("replayable://replay/create");
}
PreviousJira ButtonNextWeb

Last updated 1 year ago

Was this helpful?

💭
🔧