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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@segment/analytics.js-core

v4.1.11

Published

The hassle-free way to integrate analytics into any web application.

Downloads

220,091

Maintainers

cjo2cjo2achandrashekaranachandrashekaranaparna.singhalaparna.singhalynguyenynguyentimmyzsearcytimmyzsearcyigracheva-twilioigracheva-twilioyashnit-segmentyashnit-segmentnanotimmnanotimmsrivig21srivig21chenchensegmentcomchenchensegmentcomsanket.mishrasanket.mishralweimersegmentlweimersegmentrcheedhallarcheedhallajxin_twiliojxin_twilioodoren_segmentodoren_segmentaditi.raveeshaditi.raveeshdltnbrks-segmentdltnbrks-segmentsai-patanjalisai-patanjalihimanshuphhimanshuphalecjacobs-segmentalecjacobs-segmentsshaikh_segmentsshaikh_segmentjohn.lee1100john.lee1100dazu70dazu70brian.aguirrebrian.aguirrepooja.patilpooja.patilsegment_fansegment_fannlubchenconlubchencojamezhutwiliojamezhutwilioknksmith57-segmentknksmith57-segmentjsh-wujsh-wunithin-bennynithin-bennypoojasegmentpoojasegmentebru.odokebru.odokbannapplebannapplerodhilton_twiliorodhilton_twilioguthriesegmentguthriesegmentsrishti-nemasrishti-nemacdelaomartinezcdelaomartinezmiguelpdiaz8miguelpdiaz8sundareswar.jayakumarsundareswar.jayakumargbatragbatraspencerattickspencerattickakodankiryakodankirynanette.ranesnanette.ranesgsolis_segmentgsolis_segmentnitinpm432nitinpm432aadityabhatt10aadityabhatt10amigandhiamigandhisegmentseansegmentseanhmohanram_seghmohanram_segjrupasinghejrupasinghemyrontin.segmentmyrontin.segmentdevthaledevthalesmccoy-twiliosmccoy-twilioseg-leonelsanchesseg-leonelsanchesjibrangjibrangsethgrid_segmentsethgrid_segmentlight-bringer-blrlight-bringer-blraubreysineaubreysineed-twilion-npmed-twilion-npmharsh-joshi99harsh-joshi99irfan.ali.segmentirfan.ali.segmentkbhargavaram-sgkbhargavaram-sgneedcaffeineneedcaffeinenat-gridnat-gridwlumsegmentwlumsegmentvivek-26vivek-26moyara2moyara2bala.singareddybala.singareddygbbastosgbbastosakash.gautam07akash.gautam07preetyppreetypviveksainaneesegmentviveksainaneesegmentmsarafmsarafkjoerreskjoerresrokatyalrokatyalainatancincoainatancincoanton-vylushchakanton-vylushchaksowjanyasegmentsowjanyasegmentalayvoraalayvoramsaunders-segmentmsaunders-segmenttw-dgarciatw-dgarciaparag.pandaparag.pandablangtwilioblangtwilioryanrouleau-segmentryanrouleau-segmenttwjosiahtwjosiahmcullenmeyermcullenmeyerdavid.anusontarangkul.segmentdavid.anusontarangkul.segmentmckern_segmentmckern_segmentsegment-adminsegment-adminnainy.agrawalnainy.agrawaltdibaccotdibaccosudojatinsudojatinnageshgolemnageshgolembrandonheyer-segmentbrandonheyer-segmentalfrimpongalfrimpongdobrin.ganevdobrin.ganevankit.gupta.unthinkableankit.gupta.unthinkablemarinheromarinherobenattwiliobenattwiliobharath.boregowdabharath.boregowdaconniechenconniechensungju.jinsungju.jinpooyajpooyajyli119yli119ea_segmentea_segmentemilyjiaemilyjiakx-segmentkx-segmentcvillela_segmentcvillela_segmentxinghao.huangxinghao.huangharsh.vardhanharsh.vardhanjoe.ayoub.segmentjoe.ayoub.segmentgkochar123gkochar123rollcoderollcodeariel.silvestriariel.silvestricherylj-segmentcherylj-segmentleifdreizlerleifdreizlerimmanojimmanojaaronklishaaronklishmichelrmichelrmaneesh.dharma29maneesh.dharma29msolorzano-segmentmsolorzano-segmentbrianhumphreystwiliobrianhumphreystwiliojfehrman.segmentjfehrman.segmentjoetessyjoetessypmuninpmuninjalexy12jalexy12jbandi-twiliojbandi-twilioprayansh-twilioprayansh-twiliodominicbarnesdominicbarnesbrandon.scott-segmentbrandon.scott-segmentbgillanbgillanphillip.thomasphillip.thomasricardo.rossiricardo.rossiforgetfulfellowforgetfulfellowfauzy.yyfauzy.yymayur-pitalemayur-pitaledbaik-twilio-segmentdbaik-twilio-segmentseg-rustybaileyseg-rustybaileytanya.gupta.segmenttanya.gupta.segmentpmiller-twiliopmiller-twilionevermore2022nevermore2022aishikawakiaishikawakicsayusocsayusomcoulibalimcoulibalishupadhyayshupadhyayjahood-twiliojahood-twiliosaisagarkappaganthulasaisagarkappaganthularmukundanrmukundanarubiochavezarubiochavezshuvrajit9904shuvrajit9904s3gm3nts3gm3ntama0223ama0223tbrennanjtbrennanjdangmai-segmentdangmai-segmentshraddha-twilioshraddha-twilioazhaotwilioazhaotwiliosa-jsootersa-jsooterenyi.asonyeenyi.asonyeafsha-nazim-segafsha-nazim-segmschaszbergermschaszbergerlnambalnambavaradarajan-twvaradarajan-twseanhan-segmentseanhan-segmentreplateroreplaterosayan-das-insayan-das-injusteenjusteensausinghsausinghjgabe13jgabe13meg1000meg1000funlufunluashwitha.bgashwitha.bgwhaider_twiliowhaider_twiliotcgilberttcgilbertkevinburkesegmentkevinburkesegmentfelttripfelttripprabhnoor1997prabhnoor1997akashyap91akashyap91clintz.segclintz.segkarimkeshwanikarimkeshwaniwally.tgwally.tgrhall-twiliorhall-twilioyash-twilioyash-twiliobrookstaylorjrbrookstaylorjrshayan-golafshanishayan-golafshanilerahulramlerahulrammugelstadmugelstadhdamanihdamanirrivera-segmentrrivera-segmentsethnutetwiliosethnutetwiliomanali-bhosalemanali-bhosalechtoombschtoombssethsegmentsethsegmenteric-hydeeric-hydeelmoselyeeelmoselyeemichaelghsegmichaelghsegjayakrishnannairjayakrishnannairlateefatlateefatmaryam.sharifmaryam.sharifwdbettswdbettsryanligonryanligonsindhusegmentsindhusegmentlfdelossantoslfdelossantosaramakrishnanaramakrishnansegment-camdensegment-camdenvbatanovvbatanovlluque-twiliolluque-twiliojair.avilesjair.avilespmaidpmaidsong4yousong4youpeterdemartinipeterdemartiniemmy.byrneemmy.byrnevincen7tranvincen7trandean-huynhdean-huynhcdignam-segmentcdignam-segmentabhinavsurekaabhinavsurekaarunlalam-segmentarunlalam-segmentcjradekcjradekneeharikakondipatineeharikakondipatisimpixelatedsimpixelatedchihchun-twiliochihchun-twilioacharles14acharles14jyim008jyim008hema-segmenthema-segmentoscboscbkrousseaukrousseausachinwathoresachinwathorefhalim-segmentfhalim-segmentcfreecfreehjoonpmhjoonpmceline-segmentceline-segmentpmcanseco-segmentpmcanseco-segmentmasiramasiraamillet89amillet89cholt002cholt002av-segmentav-segmentaghotikaraghotikarvikrant-segmentvikrant-segmentlarryatsegmentlarryatsegmentariel_segmentariel_segmentscruwys1scruwys1lew-gordonlew-gordonkyliepedersenkyliepedersenjinaparkjinaparksegmentiosegmentiorajulvaderarajulvaderalpediredlalpediredlan2parkon2parkotyson_segmenttyson_segmentbgamwellbgamwelluditmehtauditmehtasalolivaressalolivareserikdwerikdwchenxiangzhangchenxiangzhangmericssonmericssonprayansh-segmenttprayansh-segmenttjeremylarkinjeremylarkinbsneedbsneeddanieljackinsdanieljackinssegment-sethsegment-sethjames9446james9446priscilla.giattipriscilla.giattikellylukellylunlsunnlsundrew-thompsondrew-thompsonsegment-jsinghsegment-jsinghandrius-segmentandrius-segmentvalerieernstvalerieernstkelcookkelcookgilomergilomermarcelopvmarcelopveric.rognereric.rognerkdharaiyakdharaiyajon.anderson-at-segment.comjon.anderson-at-segment.comstacy.songstacy.songrexatsegmentrexatsegmentnickaguilarnickaguilarbradenbeckerbradenbeckerreneewangreneewangdan.laskydan.laskysam.tapiasam.tapiavikramkumar19vikramkumar19mpriyad25mpriyad25jeremy.parkerjeremy.parkersmidgessmidges

Readme

analytics.js-core

CircleCI Codecov

This is the core of Analytics.js, the open-source library that powers data collection at Segment.

To build this into a full, usable library, see the Analytics.js repository.

Using Types (v.4.0.0-beta.0 and later)

We recently introduced Typescript support and types to Analytics.js Core. While the exposed types still need some work (pull requests are welcome!), they're ready to be used.

Importing as an npm module

If you use analytics.js-core as an npm module, you can use its types out of the box:

Using types with the AJS Snippet

If you create a source at https://app.segment.com, Segement automatically generates a JS snippet that you can add to your website. (for more information visit our documentation).

To use types with the snippet, add analytics as part of the global module. Something like this:

import { SegmentAnalytics } from '@segment/analytics.js-core';

declare global {
  interface Window {
    analytics: SegmentAnalytics.AnalyticsJS;
  }
}

Using as a standalone npm package

We recommend using the CDN version of analytics.js as it offers all the project and workspace specific settings, enabled integrations, and middleware. But if you prefer to use analytics.js-core as a standalone npm package using your own tooling & workflow, you can do the following:

1- Install the dependencies

yarn add @segment/analytics.js-core
yarn add @segment/analytics.js-integration-segmentio
// you may need this depending on the bundler
yarn add uuid@^3.4 

2- Import the dependencies

import Analytics from "@segment/analytics.js-core/build/analytics";
import SegmentIntegration from "@segment/analytics.js-integration-segmentio";

3- Initialize Segment and add Segment's own integration

// instantiate the library
const analytics = new Analytics();

// add Segment's own integration ( or any other device mode integration ) 
analytics.use(SegmentIntegration);

// define the integration settings object. 
// Since we are using only Segment integration in this example, we only have 
// "Segment.io" in the integrationSettings object
const integrationSettings = {
  "Segment.io": {
    apiKey: "<YOUR SEGMENT WRITE KEY>",
    retryQueue: true,
    addBundledMetadata: true
  }
};


// Initialize the library
analytics.initialize(integrationSettings);

// Happy tracking! 
analytics.track('🚀');

License

Released under the MIT license.