Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

🐝 Tiny Vite plugin to add Splitbee

License

Notifications You must be signed in to change notification settings

NuroDev/vite-plugin-splitbee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐝 vite-plugin-splitbee

A small plugin to add Splitbee support to Vite

License Vite Version Downloads

πŸ¦„ Usage

Install the dependency

npm install --save-dev vite-plugin-splitbee # yarn add -D vite-plugin-splitbee

Add it to your Vite config

// vite.config.ts
import Splitbee from 'vite-plugin-splitbee';

export default {
    plugins: [
        Splitbee(),
    ]
}

πŸ”§ Configuration

export default {
    plugins: [
        Splitbee({
            /// Provide a custom API url to use instead of the default Splitbee one (Optional) [Default: 'https://hive.splitbee.io']
            api_url: string,

            /// When using A/B testing, you can prevent the initial content flash by making the script blocking/synchronous (Optional) [Default: false]
            async: boolean,

            /// Whether to include Splitbee analytics during local development (Optional) [Default: false]
            dev: boolean,

            /// Whether to enable cookie-less mode (Optional) [Default: false]
            disable_cookie: boolean,

            /// To use Splitbee on another subdomain you can provide a project token. This can be found in project settings (Optional)
            token: string,

            /// URL to Splitbee script to load (Optional) [Default: 'https://cdn.splitbee.io/sb.js']
            url: string,
        }),
    ],
}

⚠️ Requirements

Currently this plugin only supports Vite 2.x