{"_id":"@apica-io/apica-rum","_rev":"2-256d9b2b9ccccab04925fc33d18978b3","name":"@apica-io/apica-rum","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@apica-io/apica-rum","version":"1.0.0","keywords":["RUM","ASM","Browser","Apica"],"author":{"name":"Apica Inc."},"license":"UNLICENSED","_id":"@apica-io/apica-rum@1.0.0","maintainers":[{"name":"apica-products","email":"productsupport@apicasystems.com"},{"name":"johansapica","email":"johan.sandqvist@apicasystems.com"},{"name":"joyce_apica","email":"joyce.thomas@apica.io"},{"name":"bhavik_apica","email":"bhavik.kathrotiya@apica.io"},{"name":"moupiyaghosh","email":"moupiya.ghosh@apica.io"}],"dist":{"shasum":"125518be551376d8d8b5f91167f189b824e3b1d6","tarball":"https://registry.npmjs.org/@apica-io/apica-rum/-/apica-rum-1.0.0.tgz","fileCount":3,"integrity":"sha512-Rkjioul6vrmQbmDed+X8UBWYMglD0Yv9lieskDxWQf38VOIduc1cXggRdgxGdtrXVKVqHTOFmWBPfw05VonIsg==","signatures":[{"sig":"MEQCICo47GhJpH2l2nbjzWqmImihiDqmLGLSzEq98+QxUO1MAiA2rgABtDjuynVru5hQjHavEFuXdnrL0stBiv+/AK7wgA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":237587},"gitHead":"9e74f0dcf26d40d457e8393a5a08f72b26cb7677","scripts":{"pack":"npm pack","build":"rm -rf .parcel-cache dist && npx parcel build apicarumwrapper.js --dist-dir dist --no-source-maps && mv dist/apicarumwrapper.js dist/ApicaRum.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"joyce_apica","email":"joyce.thomas@apica.io"},"_npmVersion":"10.8.2","description":"RUM browser instrumentation scripts","directories":{},"_nodeVersion":"18.20.6","dependencies":{"parcel":"^2.16.4","web-vitals":"^5.1.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.213.0","@opentelemetry/sdk-logs":"^0.213.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/context-zone":"^2.5.1","@opentelemetry/sdk-trace-web":"^2.5.1","@opentelemetry/semantic-conventions":"^1.40.0","@opentelemetry/exporter-logs-otlp-http":"^0.213.0","@opentelemetry/exporter-trace-otlp-http":"^0.212.0","@opentelemetry/auto-instrumentations-web":"^0.57.0","@opentelemetry/exporter-metrics-otlp-http":"^0.212.0","@opentelemetry/instrumentation-document-load":"^0.57.0","@opentelemetry/opentelemetry-browser-detector":"^0.212.0","@opentelemetry/instrumentation-user-interaction":"^0.56.0","@opentelemetry/instrumentation-xml-http-request":"^0.212.0"},"_hasShrinkwrap":false,"devDependencies":{"buffer":"^6.0.3","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/apica-rum_1.0.0_1778578206608_0.1990788733369877","host":"s3://npm-registry-packages-npm-production"},"@parcel/resolver-default":{"packageExports":true}},"1.0.1":{"name":"@apica-io/apica-rum","version":"1.0.1","scripts":{"build":"rm -rf .parcel-cache dist && npx parcel build apicarumwrapper.js --dist-dir dist --no-source-maps && mv dist/apicarumwrapper.js dist/ApicaRum.js","prepublishOnly":"npm run build","pack":"npm pack","publish":"npm publish --access public","clean":"rm -rf .parcel-cache dist"},"@parcel/resolver-default":{"packageExports":true},"keywords":["RUM","ASM","Browser","Apica"],"author":{"name":"Apica Inc."},"license":"UNLICENSED","description":"RUM browser instrumentation scripts","dependencies":{"@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.213.0","@opentelemetry/auto-instrumentations-web":"^0.57.0","@opentelemetry/context-zone":"^2.5.1","@opentelemetry/exporter-logs-otlp-http":"^0.213.0","@opentelemetry/exporter-metrics-otlp-http":"^0.212.0","@opentelemetry/exporter-trace-otlp-http":"^0.212.0","@opentelemetry/instrumentation-document-load":"^0.57.0","@opentelemetry/instrumentation-user-interaction":"^0.56.0","@opentelemetry/instrumentation-xml-http-request":"^0.212.0","@opentelemetry/opentelemetry-browser-detector":"^0.212.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.213.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-web":"^2.5.1","@opentelemetry/semantic-conventions":"^1.40.0","parcel":"^2.16.4","web-vitals":"^5.1.0"},"devDependencies":{"buffer":"^6.0.3","typescript":"^5.9.3"},"_id":"@apica-io/apica-rum@1.0.1","gitHead":"4a394caddbd3b11c9fcfe6b778fd0fa1bad9168b","_nodeVersion":"18.20.4","_npmVersion":"10.7.0","dist":{"integrity":"sha512-7r3yujOh0svlpt8XFEdOfXbynLheNHVYxiiSs6Uq0ZcGlx52uSV4O4o9cZ6KOCfgiPuv6C5ld72mwtOdbpUUUw==","shasum":"a5112e7983522e597c48130ac2987ea9aa7c7427","tarball":"https://registry.npmjs.org/@apica-io/apica-rum/-/apica-rum-1.0.1.tgz","fileCount":3,"unpackedSize":276404,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDDXkF6wbCs9NwhRZSCsUcSFmE1RTSKTfMUcMv+zTVjOQIhAIaINr+9C4i+EFEHbxzavzVrTwXuZYUUpAML5+Ath1XU"}]},"_npmUser":{"name":"joyce_apica","email":"joyce.thomas@apica.io"},"directories":{},"maintainers":[{"name":"apica-products","email":"productsupport@apicasystems.com"},{"name":"johansapica","email":"johan.sandqvist@apicasystems.com"},{"name":"joyce_apica","email":"joyce.thomas@apica.io"},{"name":"bhavik_apica","email":"bhavik.kathrotiya@apica.io"},{"name":"moupiyaghosh","email":"moupiya.ghosh@apica.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/apica-rum_1.0.1_1785758142880_0.8343360426940056"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-12T09:30:06.452Z","modified":"2026-08-03T11:55:43.352Z","1.0.0":"2026-05-12T09:30:06.747Z","1.0.1":"2026-08-03T11:55:43.017Z"},"author":{"name":"Apica Inc."},"license":"UNLICENSED","keywords":["RUM","ASM","Browser","Apica"],"description":"RUM browser instrumentation scripts","maintainers":[{"name":"apica-products","email":"productsupport@apicasystems.com"},{"name":"johansapica","email":"johan.sandqvist@apicasystems.com"},{"name":"joyce_apica","email":"joyce.thomas@apica.io"},{"name":"bhavik_apica","email":"bhavik.kathrotiya@apica.io"},{"name":"moupiyaghosh","email":"moupiya.ghosh@apica.io"}],"readme":"Apica RUM implementation based on OTEL Browser SDK and Web Vitals.\r\n\r\nThe script instruments user interactions and web page behavior in both auto and manual mode. \r\nEmits the 3 Otel signals - Logs, Metrics and Traces.\r\nAny OTEL compatible endpoint that is reachable from the script can be used as sink endpoints. Script has been fined tuned for Ascent as backend.\r\n\r\n\r\n\r\n1. Build step\r\n\r\nThere are multiple ways to build the script as follows\r\n\r\na. Need to use a build tool like parcel to get the final script \r\n\r\n    npx parcel build apicarumwrapper.js --dist-dir dist --no-source-maps\r\n\r\nb. Use the script commands available in package.json \r\n\r\n    npm run build\r\n\r\nMinified RUM file will be available in the dist directory\r\n\r\n\r\nThis can then be added to a page as below.\r\n\r\n<script>\r\n     import ApicaRum from './ApicaRum.js'\r\n      let init = {\r\n        ingestHost: 'host',\r\n        ingestToken: 'token',\r\n        sessionId: null, \r\n        appNameSpace: \"RUM_NS\", \r\n        appName: \"Index.html\", \r\n        envr: \"prod\",\r\n        emitLog:true ,emitMetric:true ,emitTrace:true , //default to true\r\n        trackLocation:true,  //default to false\r\n        logUrl:'www.google.com',metricUrl:'apica.io',traceUrl:'bbc.com' //defaul Ascent v1 endpoints used if none specified\r\n      }\r\n       \r\n     let instruments=ApicaRum(init); \r\n      instruments.then(ins => {  // Internal instruments resolved\r\n        ins.logger && console.log('logger')\r\n        ins.meter  && console.log('meter')\r\n        ins.tracer && console.log('tracer')\r\n        \r\n        //example addition of custom metric via script\r\n        const business_metrics = ins.meter.createHistogram('business_metrics', { description: 'Custom metric', unit: 'ms'});\r\n              business_metrics.record(100, { id: 1, name: 'bm' });\r\n        });\r\n</script>\r\n\r\nThis will launch auto instrumentation for the page and usage metrics will start ingestion, the script exposes the internal meters via returned object, this can be used to add custom meters e.g Business metrics of some kind\r\n\r\n\r\n2. Manual instrumentation\r\n\r\nInternal meters corresponding to logs, metrics and traces used by the script are exposed via the returned object from the init call. These meters can be used to do custom instrumentation, for example some business metrics that is relevant for monitoring.\r\n\r\n\r\n3. Code structure\r\n\r\nCode structure follows the three main signals - log.js, metric.js and trace.js \r\nThese are used in ApicaRum.js\r\napicarumwrapper.js is a wrapper for direct script import scenarios e.g script delivery via a CDN\r\n\r\n\r\n4. Packaging\r\n\r\nIts possible to create a local package for distribution by executing\r\n\r\nnpm run pack\r\n\r\n\r\n5. Publish to npm\r\n\r\nPackage needs to be published under Apica account, this requires a npm user account under Apica.\r\nNeed to login first and then publish\r\n\r\nnpm login\r\n\r\nnpm run publish\r\n\r\n\r\n\r\n\r\n","readmeFilename":"README.md"}