Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@laxels/docusaurus-plugin-segment
Advanced tools
A Docusaurus plugin for Segment API Analytics based on prior work by Moesif
Disclaimer: This is a community plugin. It may not work. Use at your own risk.
docusaurus-plugin-segment
npm install --save docusaurus-plugin-segment
docusaurus.config.js
Method a: use themeConfig with Docusaurus v1
module.exports = {
plugins: ['docusaurus-plugin-segment'],
themeConfig: {
segment: {
apiKey: 'Your Segment Write API Key',
// Add other options here.
},
},
};
Method b: use plugin options with Docusaurus v2
module.exports = {
plugins: [
'docusaurus-plugin-segment',
{
apiKey: 'Your Segment Write API Key'
// Add other options here.
}
]
}
Because the plugin is disabled when NODE_ENV
is set to development, you'll want to create a production build:
npm run build
npm run serve
Any of the Segment browser APIs are accessible via window.analytics
.
The plugin tracks page views automatically but we also recommend identifying the user like so:
window.analytics.identify("97980cfea0067", {
name: "Peter Gibbons",
email: "peter@example.com",
plan: "premium",
logins: 5
});
For full list of configuration options, see this page.
The page
option defaults to false, and the plugin will use a hook to send page tracking events.
FAQs
Segment API Analytics plugin for Docusaurus
The npm package @laxels/docusaurus-plugin-segment receives a total of 679 weekly downloads. As such, @laxels/docusaurus-plugin-segment popularity was classified as not popular.
We found that @laxels/docusaurus-plugin-segment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.