{"id":20980696,"url":"https://github.com/statful/statful-client-javascript","last_synced_at":"2025-09-13T01:36:55.673Z","repository":{"id":10079460,"uuid":"64409453","full_name":"statful/statful-client-javascript","owner":"statful","description":"Statful client for Javascript. This client is intended to gather metrics and send them to Statful.","archived":false,"fork":false,"pushed_at":"2023-03-04T02:39:30.000Z","size":3871,"stargazers_count":8,"open_issues_count":10,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-19T14:36:02.909Z","etag":null,"topics":["gather-metrics","javascript","metrics","performance","statful"],"latest_commit_sha":null,"homepage":"https://www.statful.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/statful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-28T16:02:21.000Z","updated_at":"2021-05-17T06:34:46.000Z","dependencies_parsed_at":"2024-11-19T05:47:36.117Z","dependency_job_id":null,"html_url":"https://github.com/statful/statful-client-javascript","commit_stats":{"total_commits":109,"total_committers":13,"mean_commits":8.384615384615385,"dds":0.5871559633027523,"last_synced_commit":"6855da825f2fbfe5923b0b7a59a44c2724a94f51"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/statful/statful-client-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statful","download_url":"https://codeload.github.com/statful/statful-client-javascript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-javascript/sbom","scorecard":{"id":846758,"data":{"date":"2025-08-11","repo":{"name":"github.com/statful/statful-client-javascript","commit":"6855da825f2fbfe5923b0b7a59a44c2724a94f51"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 3/11 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"65 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-273r-mgr4-v34f","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c","Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T21:40:00.549Z","repository_id":10079460,"created_at":"2025-08-23T21:40:00.549Z","updated_at":"2025-08-23T21:40:00.549Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274744493,"owners_count":25341257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gather-metrics","javascript","metrics","performance","statful"],"created_at":"2024-11-19T05:29:40.357Z","updated_at":"2025-09-13T01:36:55.650Z","avatar_url":"https://github.com/statful.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# statful-client-javascript\nStatful client for Javascript. This client is intended to gather metrics and send them to Statful.\n\n[![Build Status](https://travis-ci.org/statful/statful-client-javascript.svg?branch=master)](https://travis-ci.org/statful/statful-client-javascript)\n[![devDependency Status](https://david-dm.org/statful/statful-client-javascript/dev-status.svg)](https://david-dm.org/statful/statful-client-javascript#info=devDependencies)\n[![install size](https://packagephobia.now.sh/badge?p=statful-client-javascript)](https://packagephobia.now.sh/result?p=statful-client-javascript)\n\n\n## Table of Contents\n\n* [Supported Versions](#supported-versions)\n* [Installation](#installation)\n* [Quick Start](#quick-start)\n* [Reference](#reference)\n* [Authors](#authors)\n* [License](#license)\n\n\n## Supported Versions\n\nIt supports every browser that has full support for the ECMAScript 5 specification.\n\n\n## Installation\n\n```\nnpm install --save statful-client-javascript\n```\n\nor\n\n```\nbower install --save statful-client-javascript\n```\n\n## Quick Start\n\nAfter installing Statful Client you are ready to use it. The quickest way is to do the following:\n\n```javascript\n    \u003cscript type=\"text/javascript\" src=\"node_modules/statful-client-javascript/dist/statful.umd.min.js\"\u003e\u003c/script\u003e\n\n    \u003cscript\u003e    \n        // Init statful       \n        statful.initialize({\n            dryrun: false,\n            debug: false,\n            app: 'exampleApp',          \n            flushInterval: 5000\n        });\n\n        // Send a metric\n        statful.counter('page_load');\n    \u003c/script\u003e\n```\n\n## Reference\n\nReference if you want to take full advantage from Statful.\n\n### Global configuration\n\nThe custom options that can be set on config param are detailed below.\n\n| Option | Description | Type | Default | Required |\n|:---|:---|:---|:---|:---|\n| dryRun | Defines if metrics should be output to the logger instead of being send. | `boolean` | `false` | **NO** |\n| debug | Defines logs should be sent to console. | `boolean` | `false` | **NO** |\n| app | Defines the application global name. If specified sets a global tag `app=setValue`. | `string` | **undefined** | **NO** |\n| namespace | Defines the global namespace. | `string` | `web` | **NO** |\n| sampleRate | Defines the rate sampling. **Should be a number between [1, 100]**. | `number` | `100` | **NO** |\n| flushInterval | Defines the periodicity of buffer flushes in **milliseconds**. | `number` | `10000` | **NO** |\n| timeout | Defines the timeout. | `number` | `2000` | **NO** |\n| tags | Defines the global tags. | `object` | `{}` | **NO** |\n| aggregations | Defines the global aggregations. | `object` | `[]` | **NO** |\n| aggregationFrequency | Defines the global aggregation frequency. | `number` | `10` | **NO** |\n\n\n### Methods\n\n#### counter, gauge, timer\n\nThese methods receive a metric name and a metric value as arguments and send a counter/gauge/timer metric. \nIf the options parameter is omitted, the default values are used.\n**These methods will add metrics to a queue that will be flushed using the interval defined on flushInterval.**\n\n```javascript\nstatful.counter('myCounter', 1, {agg: ['sum']});\nstatful.gauge('myGauge', 10, { tags: { host: 'localhost' } });\nstatful.timer('myCounter', 200, {namespace: 'sandbox'});\n```\n\n#### sendMetric\n\nThis method receive a metric type, metric name and a metric value as arguments and send a counter/gauge/timer metric.\nIf the options parameter is omitted, the default values are used.\n**This method will send metrics to the server without being added to the queue.**\n\n```javascript\nstatful.sendMetric('counter', 'myCounter', 1, {agg: ['sum']});\n``` \n \nRead the methods options reference bellow to get more information about the default values.\n\n| Option | Description | Type | Default for Counter | Default for Gauge | Default for Timer |\n|:---|:---|:---|:---|:---|:---|\n| agg | Defines the aggregations to be executed. These aggregations are merged with the ones configured globally, including method defaults.\u003cbr\u003e\u003cbr\u003e **Valid Aggregations:** `avg, count, sum, first, last, p90, p95, p99, min, max` | `array` | `['sum', 'count']` | `[last]` | `['avg', 'p90', 'count']` |\n| aggFreq | Defines the aggregation frequency in **seconds**. It overrides the global aggregation frequency configuration.\u003cbr\u003e\u003cbr\u003e **Valid Aggregation Frequencies:** `10, 30, 60, 120, 180, 300` | `number` | `10` | `10` | `10` |\n| sampleRate | Defines the rate sampling. It overrides the global namespace configuration. | `number` | `100` | `100` | `100` |\n| namespace | Defines the namespace of the metric. It overrides the global namespace configuration. | `string` | `web` | `web` | `web` |\n| tags | Defines the tags of the metric. These tags are merged with the ones configured globally, including method defaults. | `object` | `{}` | `{}` | `{ unit: 'ms' }` |\n\n### Plugins\n\n* [statful-browser-plugin](https://github.com/statful/statful-browser-plugin) - add browser tags\n\n### User Timing\n\nSupport for the [user-timing](http://www.w3.org/TR/user-timing/) specification is available.\nYou can check the current compatibility table [here](https://caniuse.com/#feat=user-timing).\n\n#### Performance Mark\n\n```\nstatful.registerMark('mark_start');\nstatful.registerMark('mark_end');\n```\n\n#### Performance Measure sent to Statful as a Timer\n\n```\n// Measure and Timer between two marks\n\nstatful.registerMark('mark_start');\nstatful.registerMark('mark_end');\n\nvar options = {\n    startMark: 'mark_start',\n    endMark: 'mark_end'\n    tags: {mark: my_tag}\n}\n\nstatful.registerMeasure('measure_name', 'metric_name' options);\n```\n\n```\n// Measure and Timer from the navigationStart event until the current time\n\nvar options = {\n    tags: {mark: my_tag}\n}\n\nstatful.registerMeasure('measure_name', 'metric_name' options);\n```\n\nYou can omit both start and end mark names:\n\n* if startMark is missing it will be measured from the navigationStart event\n* if endMark is missing it will be measured until the current high precision time\n\n## Development\n\n### Installation\n\n```bash\n$ npm install\n```\n\n### Tests\n\n```bash\n$ npm test\n```\n\n### Contribute\n\nFollow the standard *Fork and Pull Request* workflow and:\n\n* Add tests for new feats\n* Make sure the test suite passes\n* Update or add documentation accordingly\n\n## Authors\n\n[Mindera - Software Craft](https://github.com/Mindera)\n\n## License\n\nStatful Javascript Client is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/statful/statful-client-javascript/master/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-client-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatful%2Fstatful-client-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-client-javascript/lists"}