Templates
To post to the various services that it supports, Shotputter uses handlebars templates that are specified in the browser configuration. These templates can be either a string, or a function that returns a string, which has access to the following variables.
logsarray of string Logs if enabled by thecaptureLogssetting in the browser configuration.logsStringstring Logs concatenated as a single string with new lines bewtween.metadataobject Any metadata that was provided by the user.metadataStringstring JSON.stringified metadata if providedsystemInfoobject System information such as screen size, browser, etc.systemInfoStringstring JSON.stringified systemInfo.messagestring The message that was typed in by the user taking the screenshot.
Ex:
const {Shotput} = require("@shotputter/browser");
Shotput({
service: {
"url": "https://api.example.com",
"template": `
reported this issue on the page
`
}
});