@swishjam/swishjam

0.0.252 • Public • Published

Swishjam

Swishjam Instrumentation
Dead Simple Open-Source Performance Tools

Swishjam Instrumentation

A Light-weight javascript tool to capture of core web vitals, page load waterfalls, & more.

Installing with NPM

npm install @swishjam/swishjam

Initialize Swishjam

import { Swishjam } from '@swishjam/swishjam'
Swishjam.init({
  reportingUrl: 'https://example.com/api/swishjam-consumer', // Update to your consumer endpoint or one provided to you by useSwishjam.com
  publicApiKey: 'some-unique-identifier' // this associates your event data with the environment
})

Full Config Settings

Swishjam.init({
  reportingUrl: 'https://yourwebsite.com/api/swishjam-consumer',
  publicApiKey: 'some-unique-identifier', // this associates your event data with the environment
  shouldCapturePerformanceEntries: true, // default is true
  performanceEntryTypesToCapture: ["paint", "longtask", "navigation", "resource", "largest-contentful-paint", "first-input", "layout-shift"], // default is full list
  mockApiCalls: false, // default false
  maxNumEventsInMemory: 25, // default 25
  reportAfterIdleTimeMs: 10_000, // default 10_000
  sampleRate: 1.0, // default 1.0
  includeSwishjamResourcesEntries: false // default false
})

Contributing

git clone git@github.com:swishjam/swishjam.git 
cd swishjam
# For contributing to Swishjam instrumentation
cd instrumentation
npm install
# **Node v16 or higher is required**

Authors

License

ISC License

Readme

Keywords

Package Sidebar

Install

npm i @swishjam/swishjam

Weekly Downloads

1

Version

0.0.252

License

ISC

Unpacked Size

24.5 kB

Total Files

13

Last publish

Collaborators

  • collin-schneider