npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rsales93/vue-vwo-abtest

v0.0.6

Published

> **Vue 3 composable for detecting VWO A/B test variations.** > Lightweight, fast, and compatible with VWO SmartCode.

Readme

📦 @rsales93/vue-vwo-abtest

Vue 3 composable for detecting VWO A/B test variations.
Lightweight, fast, and compatible with VWO SmartCode.


✨ Features

  • 📡 Detects variation via VWO.push(['onVariationApplied', ...])
  • 🍪 Cookie-based fallback detection using _vwo_uuid
  • 🧠 Smart variation hash fallback (supports multiple variations)
  • 🧩 Simple integration using Vue 3 Composition API
  • 🔌 Optional plugin support (coming soon)

📦 Installation

yarn add @rsales93/vue-vwo-abtest
# or
npm install @rsales93/vue-vwo-abtest

🚀 Usage

Basic Composable Usage

import { useVwoVariation } from '@rsales93/vue-vwo-abtest';

export default {
  setup() {
    const { variation, isLoaded } = useVwoVariation(123); // replace with your campaign ID
    return { variation, isLoaded };
  }
}

Vue Template Example

<template>
  <div v-if="isLoaded">
    <div v-if="variation === 1">Control</div>
    <div v-else-if="variation === 2">Variation A</div>
    <div v-else>Other Variation</div>
  </div>
</template>

🔧 Plugin Usage (Optional)

// plugins/vwo.js
import VwoPlugin from '@rsales/vue-vwo-abtest';

export default {
  install(app, options) {
    app.use(VwoPlugin, options); // plugin mode coming soon
  }
}

⚙️ How it Works

  1. Uses VWO SmartCode event: VWO.push(['onVariationApplied', ...])
  2. If not available, reads the _vwo_uuid cookie
  3. Hashes part of the cookie to estimate variation using modulo
  4. Defaults to 3 variations if not specified in window._vwo_exp

📁 Project Structure

src/
├── index.js       # Main composable
vite.config.js     # Build config
package.json
README.md

🚀 Release & Publish

git commit -am "feat: add support for 4+ variations"
npm version patch
npm publish --access public

🧑‍💻 Contributing

Pull requests are welcome!

git clone https://github.com/rsalesdev/vue-vwo-abtest
cd vue-vwo-abtest
yarn install
yarn dev

📃 License

MIT © Rafael Sales