{"id":19491794,"url":"https://github.com/rudderlabs/rudder-sdk-js-snippet","last_synced_at":"2025-04-25T19:32:22.472Z","repository":{"id":54446210,"uuid":"268500857","full_name":"rudderlabs/rudder-sdk-js-snippet","owner":"rudderlabs","description":"Repo with an alternative approach to rendering the rudder-analytics.js snippet dynamically in RudderStack - an open-source, warehouse-first customer data pipeline and Segment alternative.","archived":true,"fork":false,"pushed_at":"2024-01-22T10:43:05.000Z","size":620,"stargazers_count":1,"open_issues_count":9,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T19:43:49.181Z","etag":null,"topics":["javascript","rudderstack","sdk"],"latest_commit_sha":null,"homepage":"https://www.rudderstack.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/rudderlabs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-01T11:18:27.000Z","updated_at":"2024-07-30T09:45:17.000Z","dependencies_parsed_at":"2022-08-13T15:50:56.766Z","dependency_job_id":null,"html_url":"https://github.com/rudderlabs/rudder-sdk-js-snippet","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js-snippet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js-snippet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js-snippet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudderlabs%2Frudder-sdk-js-snippet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudderlabs","download_url":"https://codeload.github.com/rudderlabs/rudder-sdk-js-snippet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250882637,"owners_count":21502341,"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","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":["javascript","rudderstack","sdk"],"created_at":"2024-11-10T21:18:17.744Z","updated_at":"2025-04-25T19:32:22.092Z","avatar_url":"https://github.com/rudderlabs.png","language":"JavaScript","readme":"# What is RudderStack?\n\n[RudderStack](https://rudderstack.com/) is a **customer data pipeline** tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse.\n\nMore information on RudderStack can be found [here](https://github.com/rudderlabs/rudder-server).\n\n## About this repository\n\nThe resources in this repository allow you to render the `rudder-analytics.js` snippet dynamically, as an alternative to the preferred and recommended method, i.e. the [RudderStack JavaScript SDK quickstart guide](https://github.com/rudderlabs/rudder-sdk-js#how-to-use-the-rudderstack-javascript-sdk). \n\nNote that when using this in-browser, the global `rudderanalytics` object will not be defined until the snippet is rendered and executed. This package is supported on IE8+, Chrome, Firefox, Safari 9, Microsoft Edge, Node.js 0.10+\n\nFor IE7 support, install a global `JSON` polyfill on the page prior to loading this package.\n\n## Example\n\n```js\n// var snippet = require('@segment/snippet');\n\nvar contents = snippet.max({\n  writeKey: '1Yt0USbr7HhL1KWTpEq4Y73NCNz', // \"YOUR_WRITE_KEY\"\n  dataPlaneUri: 'https://hosted.rudderlabs.com', // \"DATA_PLANE_URI\"\n});\n```\n\n## API\n\n### snippet.max(options)\n\n  Returns the maxified version of the rudder-analytics.js snippet given a set of `options`:\n\n  * `host`: the domain name where the analytics.js script is hosted.\n  * `writeKey`: the `writeKey` from RudderStack Control Plane.\n  * `page`: the options to pass to `rudderanalytics.page`. if `page` is `false`, then the `page()` call will be omitted.\n  * `load`: if set to `false` the `load()` call will be omitted. This is useful for if you want dynamically control the load process on the client-side for things like GDPR.\n\n\n### snippet.min(options)\n\n  Returns the minified version of the snippet.\n\n## TODO\n\n- [ ] Add simple example\n- [ ] Update `test/render.test.js`\n- [ ] Update `test/snippet.test.js`\n- [ ] README add useAutoTrack \u0026 configUrl\n- [ ] README update opts description\n- [ ] CI Build for dist\n- [ ] Proper package manager set up\n\n## Contact Us\n\nIf you come across any issues while configuring or using this repository, please feel free to start a conversation on our [Slack](https://resources.rudderstack.com/join-rudderstack-slack) channel. We will be happy to help you.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudderlabs%2Frudder-sdk-js-snippet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudderlabs%2Frudder-sdk-js-snippet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudderlabs%2Frudder-sdk-js-snippet/lists"}