Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@taplytics/nuxtjs

Package Overview
Dependencies
Maintainers
8
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taplytics/nuxtjs

Simple Nuxt.js integration with Taplytics Experimentation SDK

  • 0.0.0-rc.2
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
8
Weekly downloads
 
Created
Source

Taplytics Nuxt.js Module

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).

Installation

yarn add @taplytics/nuxtjs

This module also depends on cookie-universal-nuxt

yarn add cookie-universal-nuxt

Setup

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"]
  ]
}

Options

NameDescriptionTypeDefault
ssrEnables/disables ssr integrationBooleantrue

Usage

Web modifications

Web modifications are applied automatically via the server and the client.

SDK

All SDK methods are injected into an app object called $Taplytics which can be accessed from either the client context or the server context.

All $Taplytics methods can be accessed via this.$Taplytics and context.app.$Taplytics.

featureFlagEnabled

Returns a boolean indicating if the feature flag is enabled for the active user

// from within a template
<p v-if="this.$Taplytics.featureFlagEnabled('someFeatureFlag')">
  Feature flag enabled!
</p>

<script>
  export default {
    mounted() {
      if (this.$Taplytics.featureFlagEnabled("someFeatureFlag", false)) {
        console.log("Feature flag enabled!");
      }
    },
  };
</script>
if (context.app.$Taplytics.featureFlagEnabled("someFeatureFlag", false)) {
  console.log("Feature flag enabled!");
}
variable

Returns a code variable's value

<p v-if="this.$Taplytics.variable('temperature', 50) > 70">
  It's nice out!
</p>
runningExperiments

Returns an array of running experiments

if (this.$Taplytics.runningExperiments.length > 0) {
  // this user is included in at least one experiment
}
codeBlock

Executes a block of code when a user is included in an experiment

this.$Taplytics.codeBlock("runCode", () =>
  console.log("this user is included")
);

FAQs

Package last updated on 22 Apr 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc