Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@taplytics/nuxtjs
Advanced tools
This module integrates Taplytics with your Nuxt.js server rendered application. It injects its API into your app, and applies changes universally (ie, when server rendered and when client rendered).
yarn add @taplytics/nuxtjs
This module also depends on cookie-universal-nuxt
yarn add cookie-universal-nuxt
In your nuxt.config.js
, add the following to your modules block:
export default {
...,
modules: [
...,
"@taplytics/nuxtjs",
{
token: "YOUR TOKEN",
ssr: true | false (default to true)
}
],
["cookie-universal-nuxt"]
]
}
Name | Description | Type | Default |
---|---|---|---|
ssr | Enables/disables ssr integration | Boolean | true |
Function | Description |
---|---|
identify | Identify User |
track | Track event |
page | Track page views |
runningExperiments | Get running experiments |
featureFlagEnabled | Get feature flag enabled |
variable | Get dynamic variable |
codeBlock | Run code block |
Identifies the user that's currently on the page. This helps link their activity on the web with their activity on other platforms (iOS, Android).
this.$Taplytics.identify(user_attributes);
user_attributes
(Object): User Attributes object, containing the following fields:user_id
(string/integer): User's ID (optional).email
(string): User's Email (optional).gender
(string): User's Gender, one of male
or female
(optional).age
(integer): User's age as a number (optional).firstName
(integer): User's first name (optional).lastName
(integer): User's last name (optional)....
(string/integer/object): Any extra custom attributes (optional).(Promise): Returns a promise containing the result of the call to the worker.
// With just a few named user attributes
this.$Taplytics.identify({
email: "nima@taplytics.com",
age: 23,
gender: "male",
firstName: "Nima",
lastName: "Gardideh",
});
// Return: Promise {<pending>}
// With non-named custom attributes
this.$Taplytics.identify({
user_id: 1015,
loyalty_group: "very_loyal",
purchases_count: 15,
friends_count: 800,
});
// Return: Promise {<pending>}
Tracks the occurrence of an event for the current visitor (anonymous or identified).
Note that value
is identified as revenue. If you want to send information about the event itself, send it through event_attributes
.
this.$Taplytics.track(eventName, value, attributes);
eventName
(string): Event name.value
(integer/double): Value of the event.attributes
(Object): Event attributes to be sent with the event.(Promise): Returns a promise containing the result of the call to the worker.
// Simple event
this.$Taplytics.track("Clicked Button");
// Return: Promise {<pending>}
// Event with value (revenue)
this.$Taplytics.track("Purchased", 180.5);
// Return: Promise {<pending>}
// Event with value (revenue) and extra attributes
this.$Taplytics.track("Purchased", 180.5, {
product_id: 100,
product_name: "Shirt",
});
// Return: Promise {<pending>}
// Event with just attributes and no value
this.$Taplytics.track("Finished Tutorial", null, {
time_on_tutorial: 100,
});
// Return: Promise {<pending>}
Tracks a new page and time spent on previous page if this is not the first page tracked.
this.$Taplytics.page(category, name, page_attributes);
category
(string): The category of the page.name
(string): The name of the page.page_attributes
(Object): Custom defined attributes for the page.(Promise): Returns a promise containing the result of the call to the worker.
// Track a page view with no attributes
this.$Taplytics.page();
// Return: Promise {<pending>}
// Track it by setting a name
this.$Taplytics.page(null, "Page Name");
// Return: Promise {<pending>}
// Track a page view with a category and a name
this.$Taplytics.page("Product Listings", "Shirts");
// Return: Promise {<pending>}
// Track a page view with a name and attributes
this.$Taplytics.page(null, "Shirts Page", {
products_count: 150,
});
// Return: Promise {<pending>}
// Track a page view with a name, a category, and attributes
this.$Taplytics.page("Product Listings", "Shirts", {
products_count: 150,
});
// Return: Promise {<pending>}
Returns the running experiments and corresponding variation that the current user is bucketed in.
this.$Taplytics.runningExperiments();
None.
(Object): A map of experiment names to the variation name that the current user is bucketed in.
this.$Taplytics.runningExperiments();
// Return: { "Experiment 1": "baseline", "Experiment 2": "Variation 1" }
Returns whether a feature flag is enabled for the current user.
this.$Taplytics.featureFlagEnabled(name, [(defaultValue = false)]);
name
(string): The name of the feature flag.defaultValue
(boolean): The default value of the feature flag if it does not exist. Defaults to false
.(boolean): Whether the feature flag corresponding to name
is enabled for the current user. Enabled means that the feature flag exists, is turned on in the Taplytics dashboard, and the current user satisfies the conditions of the feature flag.
this.$Taplytics.featureFlagEnabled("enabledFeatureFlag");
// Return: True
this.$Taplytics.featureFlagEnabled("disabledFeatureFlag");
// Return: False
Returns a Taplytics Dynamic Variable value that is controlled by your running experiments and configured through the Taplytics dashboard.
this.$Taplytics.variable(name, defaultValue);
name
(string): The name of the variable to retrieve.defaultValue
(string/number/boolean): Default return value if the variable does not exist.(string/number/boolean): The value of the dynamic variable by name
if it exists, otherwise returns defaultValue
.
this.$Taplytics.variable("existingVarName", "default");
// Return: "existingVarValue"
this.$Taplytics.variable("nonExistingVarName", "default");
// Return: "default"
Creates a Taplytics Code Block that will be run if enabled for the running experiment/variation through the Taplytics dashboard.
this.$Taplytics.codeBlock(name, codeBlock);
name
(string): The name of the code block.codeBlock
(function): The code block to be called if enabled for the experiment's variation.None.
this.$Taplytics.codeBlock("enabledCodeBlock", function () {
console.log("This code block is enabled for my experiment and variation!");
// run extra code here
});
// Logs: "This code block is enabled for my experiment and variation!"
// Return: undefined
this.$Taplytics.codeBlock("nonEnabledCodeBlock", function () {
console.log("This code block is either not enabled or does not exist!");
// run extra code here
});
// Return: undefined
Web modifications are applied automatically via the server and the client.
FAQs
Simple Nuxt.js integration with Taplytics Experimentation SDK
The npm package @taplytics/nuxtjs receives a total of 5 weekly downloads. As such, @taplytics/nuxtjs popularity was classified as not popular.
We found that @taplytics/nuxtjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.