Find the Quick Start Guide in our GitHub repo.
The library is distributed with NPM, install with npm:
TerminalCopy$npm i node-avo-inspector
or yarn:
TerminalCopy$yarn add node-avo-inspector
TypeScriptCopy1import * as Inspector from "node-avo-inspector";
Obtain the API key in the Inspector tab in your Avo.app workspace.
You will need to create an instance of AvoInspector with the constructor:
TypeScriptCopy123456constructor(options: {apiKey: string;env: AvoInspectorEnv;version: string;appName?: string;});
All the following methods are available in the AvoInspector class.
Parameters:
apiKey
- the API key you get in your Avo accountenv
- current environment:"dev"
,"staging"
or"prod"
appVersion
- your application version. A lot of Inspector features rely on versioning and you need to provide a comparable string here to get value from them. We recommend using semantic versioning or integers that are incremented in every release.appName
- your application name. Optional; Provide it to make it easier to distinguish between data from different apps.
This is the core of the Avo Inspector SDK.
TypeScriptCopy123trackSchemaFromEvent(eventName: string, eventProperties: {[propName: string]: any;}): void;
Parameters:
eventName
- string event name, also known as event type.eventProperties
- The actual event properties, which will be converted to an event schema on the device and the event schema sent to Avo. The resulting keys will be object field names and the values will be object field value types converted to schema types.Example format:
JavaScriptCopy12345var eventProperties = {userId: 1337,emailAddress: 'jane.doe@avo.app',key: 'value',};
enableLogging
controls printing of tracked event schemas and other helpful information to logcat. Enabled by default in development environments.
JavaScriptCopy1enableLogging(enable: boolean): void;
Parameters:
enable
- boolean flag that sets whether Avo Inspector SDK will print logs .