Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@twilio-labs/docusaurus-plugin-segment

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilio-labs/docusaurus-plugin-segment

Segment plugin for Docusaurus.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
1.2K
34.58%
Maintainers
2
Weekly downloads
 
Created
Source

docusaurus-plugin-segment

Send Docusaurus page view events to Segment. This opens up your analytics possibilities to the over 300 different integrations that Segment provides.

Installation

npm install --save @twilio-labs/docusaurus-plugin-segment

Or, if you prefer Yarn:

yarn add @twilio-labs/docusaurus-plugin-segment

Configuration

Accepted fields:

NameTypeDefaultDescription
writeKeystringRequiredThe Write Key for your Segment JavaScript source.
trackLocalSearchbooleanfalseWhether to track searches made with docusaurus-search-local
allowedInDevbooleanfalseWhether to allow tracking in development mode in addition to production.

To find your write key:

  • Login to Segment
  • Click on Connections
  • Open your JavaScript source. (If you don't have one, click Add Source to add one.)
  • Choose the Settings tab
  • Click API Keys
  • You will find the Write Key on this page.

Example configuration

docusaurus.config.js

  plugins: [
    [
      "@twilio-labs/docusaurus-plugin-segment",
      {
        writeKey: "3EBOWfRPv8qwertyZXCvbnMAsD2f1g0H",
        allowedInDev: false,
      },
    ],
  ],

Other features

Beyond sending page views to Segment, this plugin also supports sending search queries made using the docusaurus-search-local plugin.

It also supports identifying users on your system, should you have identity, by inspecting a cookie named client_id and expecting it to have the format of <unique id>|<email> (a unique identifier and email address, separated by the pipe character).

About Segment

This plugin is leveraging Segment's Analytics.js 2.0 JavaScript client (called a "source").

FAQs

Package last updated on 21 Jun 2022

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