In this section, we'll learn how to install and use Oasis Language.
if you have @masiv/analytics
npm uninstall @masiv/analytics
npm install **oasis-analytics-vite**
Now, go ahead import, and install the library in the main.js file of your project /src folder as follows:
import OasisAddonAnalytics, { OAS_CONST } from '**oasis-analytics-vite**';
Vue.use(OasisAddonAnalytics,
{
dependency: OAS_CONST.dependency.OCEAN, //use OAS_CONST.dependency.OCEAN is Ocean use OAS_CONST.dependency.MASIVAPP is MASIV
app: 'LOGIN': // name your applications
});
Here we have the dictionary of dependencies and events already defined that you can use
OAS_CONST = {
dependency: {
MASIVAPP: "MV:MAPP",
OCEAN: "OC:OAPP",
TRUESENSE: "TR:TAPP" },
app: {
LOGIN: "LOGIN",
EMAIL: "EMAIL",
OAS_NAV: "OAS-NAV"
},
eventProperties: {
status: {
initialized: "Initialized",
canceled: "Canceled",
triggered: "Triggered",
completed: "Completed",
loaded: "loaded",
failed: "Failed",
validated: "Validated",
rejected: 'Rejected',
denied: 'Denied',
pending: "Pending",
resumed: "Resumed",
archived: "Archived",
},
type: {
userEvent: "user-event",
appEvent: "app-event",
apiRequest: "api-request",
errorEvent: "error-event",
notificationEvent: "notification-event",
trackingEvent: "tracking-event",
customEvent: "custom-event"
},
},
}
import { OAS_CONST, OasisAnalytic } from 'oasis-analytics-vite';
OasisAnalytic.insertUserId(username.value);
import { OasisAnalytic, OAS_CONST } from 'oasis-analytics-vite';
OasisAnalytic.insertLogEvent('LOGIN_RESPONSE', {
status: OAS_CONST.eventProperties.status.completed,
type: OAS_CONST.eventProperties.type.appEvent,
payload: { // your payload }, // This field is opcional y will be stored in encrypted form
})
Your registered amplitude event would be as follows