Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
vue-impression-tracker
Advanced tools
Readme
This library is used to track impressions using a Vue mixin. It currently support Vue v2 applications.
This library defines a Vue Mixin which accepts props, generates an impression id, and calls your provided logImpression function when a piece of content is viewed. Include the Mixin in your component with the following code:
<script setup lang="ts">
defineProps({
// Required props:
// The function to log the impression.
logImpression: Function,
// ID for the piece of content we are tracking,.
contentId: String,
// A function to generate a UUID.
uuid: Function,
// Optional props:
// The function to log an action or click.
logAction: Function,
// Called when an error occurs. Defaults to console.error.
handleError: Function,
// Specifies the source type. Defaults to DELIVERY.
defaultSourceType: [Number, String],
// Specify an insertion id. Defaults to undefined.
insertionId: String,
// Specify an impression id. Defaults to generating one with the required uuid function.
impressionId: String,
});
</script>
<template>
<div>Your Content</div>
</template>
<script lang="ts">
import impressionTracker from "vue-impression-tracker";
export default {
mixins: [impressionTracker],
};
</script>
Also reference the Sending Engagements on Web docs.
<script setup lang="ts">
import { createEventLogger } from 'promoted-snowplow-logger';
import { v4 } from "uuid";
const handleError = process.env.NODE_ENV !== 'production' ? (err) => { throw err; } : console.error;
const eventLogger = createEventLogger({
enabled: true,
platformName: 'mymarket',
handleError,
});
const logImpression = eventLogger.logImpression;
const logAction = eventLogger.logAction;
const uuid = v4;
</script>
<template>
<YourComponent :logImpression="logImpression" :logAction="logAction" :uuid="uuid" :handleError="handleError">
</template>
<script setup lang="ts">
defineProps({
logAction: Function,
});
</script>
<template>
<div v-on:click="logActionFunctor">Your Content</div>
<div v-on:click="logActionFunctor({
impressionId: "my-custom-impression-id"
actionType: 2,
elementId: "some-element-id";
targetUrl: "https://mysite.com/content/123"
})">With a custom impression id</div>
</template>
<script lang="ts">
import impressionTracker from "vue-impression-tracker";
export default {
mixins: [impressionTracker],
};
</script>
Run the watcher with: yarn build:watch
.
Symlink the built module if you haven't yet.
cd dist
yarn link
Run unit tests with yarn test
or link the built module to a test app.
yarn link vue-impression-tracker
We use a GitHub action that runs semantic-release to determine how to update versions. Just do a normal code review and this should work. Depending on the message prefixes (e.g. feat:
, fix:
, clean:
, docs:
), it'll update the version appropriately.
When doing a breaking change, add BREAKING CHANGE:
to the PR. The colon is important.
FAQs
This library is used to track impressions using a Vue mixin. It currently support Vue v2 applications.
The npm package vue-impression-tracker receives a total of 2 weekly downloads. As such, vue-impression-tracker popularity was classified as not popular.
We found that vue-impression-tracker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.