None needed. Just clone & reference the main src/index.js file.
$ npm i
$ npm test
See example.
<!-- myfile.html -->
<script src="path/to/client-log/index.js"></script>
// myfile.js
if (!window.clientLog)
throw new Error('Failed to init clientLog')
// or if using via Node,
const clientLog = require('client-log')
var log = clientLog({
endpoints: {
logs: 'http://localhost:8080/logs',
errors: 'http://localhost:8080/errors'
}
})
// window.error will now automatically be captured,
// but to trigger an event manually
log.sendLog('message', 'file.html', 1, 2, { foo: 'bar' })