Modules
module-console
Console module allows printing tracked events to the browser or Node.js console.
Installation#
Install with npm in your application:
Command
$ npm install --save \ @eventvisor/sdk \ @eventvisor/module-console
Setting up#
And then set it up when initializing the SDK:
import { createInstance } from "@eventvisor/sdk";import { createConsoleModule } from "@eventvisor/module-console";const eventvisor = createInstance({ modules: [ createConsoleModule(), ]});
Usage example#
In your destination definition:
destinations/browser.yml
# ...transport: console
Additional options#
By default, the module will be made available as console
.
You can customize it further by passing a different name:
const eventvisor = createInstance({ modules: [ createConsoleModule(), // defaults to "console" // you can set the same module again under a different name createConsoleModule({ name: "myConsole", // optionally pass a different `console` object console: console, }), ],})
You can choose console
and/or myConsole
as the transport name in your destinations as you see fit.