Socket
Socket
Sign inDemoInstall

svelte-split-testing

Package Overview
Dependencies
21
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    svelte-split-testing

Run Split Tests (or A/B tests) with the power of Svelte(Kit)


Version published
Weekly downloads
455
increased by13.47%
Maintainers
1
Install size
19.6 kB
Created
Weekly downloads
 

Readme

Source

Svelte Split Testing

npm version npm downloads bundle size

Run Split Tests (or A/B tests) with the power of Svelte(Kit). Split tests (or A/B tests) allow you to display different features or variants to test their effectiveness. Unfortunately popular options are very pricey, bloated, and don't work SSR. This package attempts to remedy all of that.

This package works with Svelte and SvelteKit.

  • Works SSR
  • Works with or without Kit
  • Works with GTM and GA4, or any other analytics solution
  • Lightweight
  • Free, of course

Demo and Docs: https://svelte-split-testing.playpilot.com/

Installation

Install using Yarn or NPM.

yarn add svelte-split-testing --dev
npm install svelte-split-testing --save-dev

Include the component in your app.

import { SplitTest } from "svelte-split-testing"
<SplitTest>...</SplitTest>

Configuration

For more configuration refer to the documentation: https://svelte-split-testing.playpilot.com/

Properties

This is a list of all configurable properties for each component and function.

SplitTest
PropertyDefaultDescription
key'Some Key'Key used to identify the current Split Test. This is primary used during analytics tracking.
variants['Variant A', 'Variant B']An array of variant names. Can be as many variants as you like. What the names are is not important, but they show up during analytics tracking.
onViewnullOptional function to be passed to track views of the current variant. Replaces the default GTM method.
serverGetSplitTestIdentifier
PropertyDefaultDescription
serverCookiesnullCookies object as served from +layout.server.js during SSR.
options{ userIdentifier, cookieName }Object of configurable options
options.userIdentifiernullAn optional user identifier to use as the identifier. This is used to show a user the same split test across different devices, as long as they have the same identifier. If an identifier was already set before the user identifier
options.cookieName'splitTestIdentifier'The name of the cookie used to store the split testing identifier.
clientGetSplitTestIdentifier
PropertyDefaultDescription
options{ userIdentifier, cookieName }Object of configurable options
options.userIdentifiernullAn optional user identifier to use as the identifier. This is used to show a user the same split test across different devices, as long as they have the same identifier. If an identifier was already set before the user identifier
options.cookieName'splitTestIdentifier'The name of the cookie used to store the split testing identifier.

Keywords

FAQs

Last updated on 10 Oct 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc