{"id":19491677,"url":"https://github.com/rudderlabs/rudder-sdk-js","last_synced_at":"2026-04-02T11:53:26.818Z","repository":{"id":35265114,"uuid":"214377595","full_name":"rudderlabs/rudder-sdk-js","owner":"rudderlabs","description":"JavaScript SDK for RudderStack - the Customer Data Platform for Developers.","archived":false,"fork":false,"pushed_at":"2026-03-30T12:26:39.000Z","size":57455,"stargazers_count":170,"open_issues_count":12,"forks_count":9,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2026-03-30T13:30:21.628Z","etag":null,"topics":["analytics","cdp","customer-data","customer-data-pipeline","customer-data-platform","data-synchronization","hacktoberfest","javascript","marketing-analytics","marketing-automation","product-analytics","product-personalization","rudderstack","sdk","segment-alternative","web"],"latest_commit_sha":null,"homepage":"https://www.rudderstack.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudderlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-11T07:57:42.000Z","updated_at":"2026-03-30T11:47:47.000Z","dependencies_parsed_at":"2026-02-18T12:39:49.208Z","dependency_job_id":null,"html_url":"https://github.com/rudderlabs/rudder-sdk-js","commit_stats":{"total_commits":3257,"total_committers":82,"mean_commits":39.71951219512195,"dds":0.789990789069696,"last_synced_commit":"9f774c15c8acaa329bce754989ac0a4ae29a2f6e"},"previous_names":[],"tags_count":1151,"template":false,"template_full_name":null,"purl":"pkg:github/rudderlabs/rudder-sdk-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudderlabs","download_url":"https://codeload.github.com/rudderlabs/rudder-sdk-js/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js/sbom","scorecard":{"id":789125,"data":{"date":"2025-08-11","repo":{"name":"github.com/rudderlabs/rudder-sdk-js","commit":"381b913609da5b23dde5e84747927a65e1f5d5de"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.8,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","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":"Maintained","score":10,"reason":"30 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"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":"Dangerous-Workflow","score":0,"reason":"dangerous workflow patterns detected","details":["Warn: script injection with untrusted input ' github.event.pull_request.head.ref ': .github/workflows/publish-new-release.yml:29"],"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/check_pr_title.yml:1","Warn: no topLevel permission defined: .github/workflows/create-hotfix-branch.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/deploy-beta.yml:17","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/deploy-beta.yml:18","Warn: no topLevel permission defined: .github/workflows/deploy-dev.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/deploy-npm.yml:52","Warn: no topLevel permission defined: .github/workflows/deploy-prod.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/deploy-sanity-suite.yml:55","Warn: no topLevel permission defined: .github/workflows/deploy-staging.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/deploy.yml:63","Warn: no topLevel permission defined: .github/workflows/draft-new-release.yml:1","Warn: no topLevel permission defined: .github/workflows/housekeeping.yaml:1","Warn: no topLevel permission defined: .github/workflows/publish-new-release.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/rollback.yml:12","Warn: no topLevel permission defined: .github/workflows/run-e2e-regression-test-suites.yml:1","Warn: no topLevel permission defined: .github/workflows/security-code-quality-and-bundle-size-checks.yml:1","Warn: no topLevel permission defined: .github/workflows/unit-tests-and-lint.yml:1","Warn: no topLevel permission defined: .github/workflows/validate-actor.yml:1","Info: no jobLevel write permissions found"],"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":"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":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"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":8,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'develop'","Info: 'force pushes' disabled on branch 'develop'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'develop'","Info: 'stale review dismissal' is required to merge on branch 'develop'","Warn: required approving review count is 1 on branch 'develop'","Info: codeowner review is required on branch 'develop'","Info: 'last push approval' is required to merge on branch 'develop'","Info: 'up-to-date branches' is required to merge on branch 'develop'","Info: status check found to merge onto on branch 'develop'","Info: PRs are required in order to make changes on branch 'develop'"],"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":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/deploy-dev.yml:22","Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/deploy-prod.yml:24","Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/deploy-staging.yml:26","Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/publish-new-release.yml:24","Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/rollback.yml:43","Warn: third-party GitHubAction not pinned by hash: .github/workflows/check_pr_title.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/check_pr_title.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/create-hotfix-branch.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/create-hotfix-branch.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-beta.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy-beta.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-beta.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy-beta.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-npm.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy-npm.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-npm.yml:115: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy-npm.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-sanity-suite.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy-sanity-suite.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-sanity-suite.yml:115: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy-sanity-suite.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:104: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:135: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/deploy.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/draft-new-release.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/draft-new-release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/draft-new-release.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/draft-new-release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/draft-new-release.yml:217: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/draft-new-release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/draft-new-release.yml:251: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/draft-new-release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/housekeeping.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/housekeeping.yaml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/housekeeping.yaml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/housekeeping.yaml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-new-release.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/publish-new-release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-new-release.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/publish-new-release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rollback.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/rollback.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rollback.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/rollback.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rollback.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/rollback.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rollback.yml:130: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/rollback.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-e2e-regression-test-suites.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/run-e2e-regression-test-suites.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-e2e-regression-test-suites.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/run-e2e-regression-test-suites.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-e2e-regression-test-suites.yml:118: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/run-e2e-regression-test-suites.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:89: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:95: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:126: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security-code-quality-and-bundle-size-checks.yml:132: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/security-code-quality-and-bundle-size-checks.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-tests-and-lint.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/unit-tests-and-lint.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-tests-and-lint.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/rudderlabs/rudder-sdk-js/unit-tests-and-lint.yml/develop?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/draft-new-release.yml:107","Info:   0 out of  34 GitHub-owned GitHubAction dependencies pinned","Info:  16 out of  18 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"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":"SAST","score":8,"reason":"SAST tool is not run on all commits -- score normalized to 8","details":["Warn: 25 commits out of 30 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":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q"],"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-23T06:57:24.170Z","repository_id":35265114,"created_at":"2025-08-23T06:57:24.170Z","updated_at":"2025-08-23T06:57:24.170Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["analytics","cdp","customer-data","customer-data-pipeline","customer-data-platform","data-synchronization","hacktoberfest","javascript","marketing-analytics","marketing-automation","product-analytics","product-personalization","rudderstack","sdk","segment-alternative","web"],"created_at":"2024-11-10T21:17:45.443Z","updated_at":"2026-04-02T11:53:26.811Z","avatar_url":"https://github.com/rudderlabs.png","language":"TypeScript","readme":"## [![Releases](https://img.shields.io/github/release/rudderlabs/rudder-sdk-js.svg)](https://github.com/rudderlabs/rudder-sdk-js/releases) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](https://www.typescriptlang.org/) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rudderlabs_repo_rudder-sdk-js\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rudderlabs_repo_rudder-sdk-js) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=rudderlabs_repo_rudder-sdk-js\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=rudderlabs_repo_rudder-sdk-js) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=rudderlabs_repo_rudder-sdk-js\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=rudderlabs_repo_rudder-sdk-js) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=rudderlabs_repo_rudder-sdk-js\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=rudderlabs_repo_rudder-sdk-js) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=rudderlabs_repo_rudder-sdk-js\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=rudderlabs_repo_rudder-sdk-js) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/rudderlabs/rudder-sdk-js)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rudderstack.com/\"\u003e\n    \u003cimg alt=\"RudderStack\" width=\"512\" src=\"https://raw.githubusercontent.com/rudderlabs/rudder-sdk-js/develop/assets/rs-logo-full-light.jpg\"\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ccaption\u003eThe Customer Data Platform for Developers\u003c/caption\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\n    \u003ca href=\"https://rudderstack.com\"\u003eWebsite\u003c/a\u003e\n    ·\n    \u003ca href=\"https://rudderstack.com/docs/stream-sources/rudderstack-sdk-integration-guides/rudderstack-javascript-sdk/\"\u003eDocumentation\u003c/a\u003e\n    ·\n    \u003ca href=\"https://rudderstack.com/join-rudderstack-slack-community\"\u003eCommunity Slack\u003c/a\u003e\n  \u003c/b\u003e\n\u003c/p\u003e\n\n---\n\n# RudderStack JavaScript SDK\n\nThe JavaScript SDK lets you track customer event data from your website and send it to your specified destinations via RudderStack.\n\n\u003e For detailed documentation on the RudderStack JavaScript SDK, click [**here**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/).\n\n## Table of Contents\n\n- [**Installing the JavaScript SDK**](#installing-the-javascript-sdk)\n- [**Migrating SDK from an older version**](#migrating-sdk-from-an-older-version)\n- [**Loading the SDK**](#loading-the-sdk)\n- [**Identifying your users**](#identifying-users)\n- [**Tracking user actions**](#tracking-user-actions)\n- [**The `ready` API**](#the-ready-api)\n- [**Self-hosted control plane**](#self-hosted-control-plane)\n- [**Adding your own integrations**](#adding-your-own-integrations)\n- [**How to build the SDK**](#how-to-build-the-sdk)\n- [**Usage in Chrome Extensions**](#usage-in-chrome-extensions)\n- [**Usage in Serverless Runtimes**](#usage-in-serverless-runtimes)\n\n| **IMPORTANT**: The service worker export has been deprecated from the RudderStack JavaScript SDK NPM package and moved to a new package. \u003cbr/\u003eIf you still wish to use it for your project, see [**@rudderstack/analytics-js-service-worker package**](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker). |\n| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n\n## Installing the JavaScript SDK\n\n| For detailed installation steps, see the [JavaScript SDK documentation](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/installation/). |\n| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n\n### Using CDN\n\nSee [CDN installation](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/quickstart/#using-cdn) for detailed steps.\n\nTo load SDK script on to your page synchronously, see the [**JavaScript SDK documentation**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/installation/#synchronous-loading).\n\n\u003e **IMPORTANT**: The implicit `page` call at the end of the snippet (present in the previous JavaScript SDK versions) is removed in the latest SDK (v3). You need to make a `page` call explicitly, if required, as shown below:\n\n```javascript\nrudderanalytics.page();\n```\n\n### Using NPM\n\nAlthough we recommend using the CDN installation method to use the JavaScript SDK with your website, you can also use this [**NPM module**](https://www.npmjs.com/package/@rudderstack/analytics-js) to package RudderStack directly into your project.\n\nTo install the SDK via NPM, run the following command:\n\n```bash\nnpm install @rudderstack/analytics-js --save\n```\n\n**Note that this NPM module is only meant to be used for a browser installation**. If you want to integrate RudderStack with your Node.js application, see the [**RudderStack Node.js documentation**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-node-sdk/).\n\n**IMPORTANT**: Since the module exports the [**related APIs**](#exported-apis) on an already-defined object combined with the Node.js module caching, you should run the following code snippet only once and use the exported object throughout your project:\n\n- **For ECMAScript modules (ESM)**:\n\n```javascript\nimport { RudderAnalytics } from '@rudderstack/analytics-js';\n\nconst rudderAnalytics = new RudderAnalytics();\nrudderAnalytics.load(\u003cWRITE_KEY\u003e, \u003cDATA_PLANE_URL\u003e, {});\n\nexport { rudderAnalytics };\n```\n\n- **For CJS using the `require` method**:\n\n```javascript\nvar RudderAnalytics = require('@rudderstack/analytics-js');\n\nconst rudderAnalytics = new RudderAnalytics();\nrudderAnalytics.load(\u003cWRITE_KEY\u003e, \u003cDATA_PLANE_URL\u003e, {});\n\nexports.rudderAnalytics = rudderAnalytics;\n```\n\n### Sample implementations\n\nSee the following applications for a detailed walkthrough of the above steps:\n\n- [**Sample Angular application**](https://github.com/rudderlabs/rudder-sdk-js/tree/main/examples/angular/)\n- [**Sample React application**](https://github.com/rudderlabs/rudder-sdk-js/tree/main/examples/reactjs/)\n\nSee the `examples` directory in this repository for more sample applications for different frameworks.\n\n## Migrating SDK from an older version\n\nIf you are migrating the JavaScript SDK from an older version (\u003c= v1.1), see the [Migration Guide](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/) for details.\n\n## Loading the SDK\n\n| For detailed information on the `load` API, see the [**JavaScript SDK documentation**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk/). |\n| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n\nYou can load the JavaScript SDK using the `load` API to track and send events from your website to RudderStack. Make sure to replace the write key and data plane URL with their actual values.\n\n```javascript\nrudderanalytics.load(\u003cWRITE_KEY\u003e, \u003cDATA_PLANE_URL\u003e, [loadOptions]);\n```\n\nYou can use the [`loadOptions`](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk/#loading-options) object in the above `load` call to define various [options](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk/#loading-options) while loading the SDK.\n\n## Identifying users\n\nThe [`identify`](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/supported-api/#identify) API lets you identify a visiting user and associate them to their actions. It also lets you record the traits about them like their name, email address, etc.\n\nA sample `identify` call is shown below:\n\n```javascript\nrudderanalytics.identify(\n  '1hKOmRA4el9Zt1WSfVJIVo4GRlm',\n  {\n    firstName: 'Alex',\n    lastName: 'Keener',\n    email: 'alex@example.com',\n    phone: '+1-202-555-0146',\n  },\n  {\n    page: {\n      path: '/best-seller/1',\n      referrer: 'https://www.google.com/search?q=estore+bestseller',\n      search: 'estore bestseller',\n      title: 'The best sellers offered by EStore',\n      url: 'https://www.estore.com/best-seller/1',\n    },\n  },\n  () =\u003e {\n    console.log('Identify call is successful.');\n  },\n);\n```\n\nIn the above example, the JavaScript SDK captures the user information like `userId`, `firstName`, `lastName`, `email`, and `phone`, along with the default [**contextual information**](https://www.rudderstack.com/docs/event-spec/standard-events/common-fields/#contextual-fields).\n\n\u003e There is no need to call `identify` API for anonymous visitors to your website. Such visitors are automatically assigned an `anonymousId`.\n\nSee the [**JavaScript SDK documentation**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/supported-api/#identify) for more information on how to use the `identify` API.\n\n## Tracking user actions\n\nThe [`track`](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/supported-api/#track) API lets you capture the user events along with any associated properties.\n\nA sample `track` API is shown below:\n\n```javascript\nrudderanalytics.track(\n  'Order Completed',\n  {\n    revenue: 30,\n    currency: 'USD',\n    user_actual_id: 12345,\n  },\n  () =\u003e {\n    console.log('Track call is successful.');\n  },\n);\n```\n\nIn the above example, the `track` API tracks the user event `Order Completed` and information like the `revenue`, `currency`, etc.\n\n\u003e You can use the `track` API to track various success metrics for your website like user signups, item purchases, article bookmarks, and more.\n\n## Ready state\n\nThere are cases when you may want to tap into the features provided by the end-destination SDKs to enhance tracking and other functionalities. The JavaScript SDK exposes a [`ready`](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/supported-api/#ready-api) API with a `callback` parameter that fires when the SDK is done initializing itself and the device-mode destinations.\n\nAn example is shown in the following snippet:\n\n```javascript\nrudderanalytics.ready(() =\u003e {\n  console.log('We are all set!!!');\n});\n```\n\n### Loaded state\n\nAlternatively, if you just want to wait for the SDK to load, you can use the [`onLoaded`](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk/#onloaded) load API option to configure a callback function.\n\nThe configured callback function is executed when the SDK has loaded successfully but before all the device-mode destinations are initialized.\n\nThis is especially helpful to query information from the SDK after it has loaded to use it elsewhere. For example, you can retrieve the anonymous ID generated by the SDK after it has loaded.\n\nAn example is shown in the following snippet:\n\n```javascript\nrudderanalytics.load(\u003cWRITE_KEY\u003e, \u003cDATA_PLANE_URL\u003e, {\n  onLoaded: () =\u003e {\n    console.log('SDK has loaded.');\n    console.log('Anonymous ID:', rudderanalytics.getAnonymousId());\n  },\n});\n\n```\n\n\u003e For more information on the other supported methods, see the [**JavaScript SDK APIs**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/supported-api/).\n\n## [](https://github.com/rudderlabs/rudder-sdk-js/blob/main/README.md#self-hosted-control-plane)Self-hosted control plane\n\n| **[Control Plane Lite](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/control-plane-lite/) is now deprecated. It will not work with the latest rudder-server versions (after v1.2). Using [RudderStack Open Source](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/control-plane-setup/#rudderstack-open-source) to set up your control plane is strongly recommended.** |\n| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n\nIf you are self-hosting the control plane using the [**Control Plane Lite**](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/control-plane-lite/) utility, your `load` call will look like the following:\n\n```javascript\nrudderanalytics.load(\u003cWRITE_KEY\u003e, \u003cDATA_PLANE_URL\u003e, {\n  configUrl: \u003cCONTROL_PLANE_URL\u003e,\n});\n```\n\nMore information on obtaining the `CONTROL_PLANE_URL` can be found [**here**](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/control-plane-lite/#using-sdk-sources-set-up-in-self-hosted-control-plane).\n\n## How to build the SDK\n\n- Look for run scripts in the `package.json` file for getting the browser minified and non-minified builds. The builds are updated in the `dist` folder of the directory. Among the others, some of the important ones are:\n\n  - `npm run build:browser`: This outputs the **dist/cdn/legacy/rsa.min.js**.\n  - `npm run build:npm`: This outputs the **dist/npm** folder that contains the NPM package contents.\n  - `npm run build:integration:all`: This outputs the **dist/cdn/legacy** folder that contains the integrations.\n\n\u003e We use **rollup** to build our SDKs. The configuration for it is present in the `rollup-configs` directory.\n\n- For adding or removing integrations, modify the imports in `index.js` under the `src/integrations` folder.\n\n## Usage in Chrome extensions\n\nYou can use the JavaScript SDK in Chrome Extensions with manifest v3, both as a content script (via the JavaScript SDK package) or as a background script service worker (via the [service worker package](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker)).\n\nFor more details, see [Chrome Extensions Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/chrome-extension/USAGE.md).\n\n## Usage in Serverless runtimes\n\nRudderStack JS SDK [service worker](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker) can be used in serverless runtimes like Cloudflare Workers or Vercel Edge functions.\n\nFor more details, see:\n\n- [Vercel Edge Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/serverless/USAGE.md)\n- [Cloudflare Worker Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/serverless/USAGE.md)\n\n## License\n\nThis project is licensed under the Elastic License 2.0. See the [LICENSE.md](LICENSE.md) file for details. Review the license terms to understand your permissions and restrictions.\n\nIf you have any questions about licensing, please [contact us](#contact-us) or refer to the [official Elastic licensing](https://www.elastic.co/licensing/elastic-license) page.\n\n## Contribute\n\nWe encourage contributions to this project. For detailed guidelines on how to contribute, please refer to [**here**](./CONTRIBUTING.md).\n\n## Contact us\n\nFor more information on any of the sections covered in this readme, you can [**contact us**](mailto:%20docs@rudderstack.com) or start a conversation on our [**Slack**](https://resources.rudderstack.com/join-rudderstack-slack) channel.\n\n## Follow Us\n\n- [RudderStack Blog][rudderstack-blog]\n- [Slack][slack]\n- [Twitter][twitter]\n- [LinkedIn][linkedin]\n- [dev.to][devto]\n- [Medium][medium]\n- [YouTube][youtube]\n- [HackerNews][hackernews]\n- [Product Hunt][producthunt]\n\n## :clap: Our Supporters\n\n[![Stargazers repo roster for @rudderlabs/rudder-sdk-js](https://reporoster.com/stars/rudderlabs/rudder-sdk-js)](https://github.com/rudderlabs/rudder-sdk-js/stargazers)\n\n[![Forkers repo roster for @rudderlabs/rudder-sdk-js](https://reporoster.com/forks/rudderlabs/rudder-sdk-js)](https://github.com/rudderlabs/rudder-sdk-js/network/members)\n\n\u003c!----variables----\u003e\n\n[rudderstack-blog]: https://rudderstack.com/blog/\n[slack]: https://resources.rudderstack.com/join-rudderstack-slack\n[twitter]: https://twitter.com/rudderstack\n[linkedin]: https://www.linkedin.com/company/rudderlabs/\n[devto]: https://dev.to/rudderstack\n[medium]: https://rudderstack.medium.com/\n[youtube]: https://www.youtube.com/channel/UCgV-B77bV_-LOmKYHw8jvBw\n[hackernews]: https://news.ycombinator.com/item?id=21081756\n[producthunt]: https://www.producthunt.com/posts/rudderstack\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudderlabs%2Frudder-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudderlabs%2Frudder-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudderlabs%2Frudder-sdk-js/lists"}