0.1.2 โ€ข Published 1 year ago

@knowdev/trace v0.1.2

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
1 year ago

KnowDev Trace ๐Ÿงถ

Project browser tagging and tracking

๐Ÿ“‹ Usage

Installation

npm install --save @knowdev/trace

Example

src/plugins/trace.js

import trace from "@knowdev/trace";

export default function (app) {
  app.use(trace, {
    // cookieName: "_kds-tr",

    // Options from vue-cookie-next (defaults shown)
    // domain: ""
    // expire: "395d"
    // path: "/"
    // sameSite: ""
    // secure: ""
  });
}

src/plugins/index.js

// ...
import trace from "./trace";

export function registerPlugins(app) {
  // ...
  app.use(trace);
}

src/App.vue

<script setup>
import trace from "@knowdev/trace";
import { onBeforeMount } from "vue";

onBeforeMount(() => {
  console.log("id :>> ", trace.getBrowserId());
});
</script>

<template>
  <router-view />
</template>

๐Ÿ“– Reference

๐Ÿ’ป Development

When the plugin is registered, when app.use(trace) is called, the object's install method is called. That is src/install.function.js.

๐Ÿ“ Changelog

DateVersionSummary
12/31/20230.0.1First commit
12/31/20230.1.0Set and retrieve browser id cookie
1/5/20230.1.1Switch to vue-cookie-next

๐Ÿ›ฃ Roadmap

  • 0.1.X - Give browser id an advanced (infinite?) expiration
  • 0.2.0 - Send a trace ping to a server

Wishlist ๐ŸŒ 

๐Ÿ“Ž Footnotes

Why 395d? It it closer to the recommended maximum (400d) but easier to spot the day it was generated since it will be 13 months-ish.

๐Ÿ“œ License

All rights reserved. Safe for use around pets.

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago