{"id":22199232,"url":"https://github.com/babbel/miza-kinesis","last_synced_at":"2025-07-27T02:31:56.808Z","repository":{"id":36955674,"uuid":"236685909","full_name":"babbel/miza-kinesis","owner":"babbel","description":"Library to Track Events to Kinesis Ingress Events Queue","archived":false,"fork":false,"pushed_at":"2024-11-18T09:38:23.000Z","size":604,"stargazers_count":3,"open_issues_count":9,"forks_count":1,"subscribers_count":56,"default_branch":"master","last_synced_at":"2024-12-01T13:42:10.987Z","etag":null,"topics":["javascript","library","npm"],"latest_commit_sha":null,"homepage":"","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/babbel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-28T08:07:42.000Z","updated_at":"2024-11-27T08:30:26.000Z","dependencies_parsed_at":"2024-06-26T12:07:52.096Z","dependency_job_id":"c439a698-a446-4004-8435-dbaa876dc4cc","html_url":"https://github.com/babbel/miza-kinesis","commit_stats":{"total_commits":93,"total_committers":14,"mean_commits":6.642857142857143,"dds":0.8387096774193549,"last_synced_commit":"8542c1fc49e3eb8a9e373aafd6ad33745f7f21cd"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fmiza-kinesis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fmiza-kinesis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fmiza-kinesis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fmiza-kinesis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babbel","download_url":"https://codeload.github.com/babbel/miza-kinesis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227750220,"owners_count":17814129,"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","library","npm"],"created_at":"2024-12-02T15:13:42.797Z","updated_at":"2025-07-27T02:31:56.789Z","avatar_url":"https://github.com/babbel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Miza-Kinesis\n\nProvides an interface to create tracking events which are sent to AWS Kinesis.\n\n## Requirements\n\n- [Nodejs](https://nodejs.org/en/download/) \u003e= 18 with NPM version \u003e= 10\n\n## Development\n\nInstall dependencies:\n\n```bash\nnpm install @babbel/miza-kinesis --save\n```\n\n## Build\n\n```bash\nnpm run build\n```\n\n## Tests\n\n```bash\nnpm test\n```\n\n## Usage\n\nConfig to track single event:\n\n```js\nconst config = {\n  appName: 'application-name',\n  kinesisStream: {\n    arn: 'Kinesis arn',\n    connectTimeout: 1000,\n    maxRetries: 10,\n  },\n  ipv4: '127.0.0.1', // optional\n  endpoint: 'http://localhost:4568', // localstack only\n};\n```\n\nCode Example:\n\n```js\nconst events = require('@babbel/miza-kinesis');\n\nconst emitEvent = events(config);\n\nconst event = {\n  name: 'request:performed',\n  meta: {\n    // ...\n  },\n  // ... more\n};\n\ntry {\n  const data = await emitEvent(event);\n  console.log(data)\n}\ncatch(error) {\n  console.error(error);\n}\n\n```\n\nConfig to track multiple events:\n\n```js\nconst config = {\n  appName: 'application-name',\n  kinesisStream: {\n    arn: 'Kinesis arn',\n    httpOptions: {\n      connectTimeout: 1000,\n      timeout: 1000,\n    },\n    maxRetries: 10,\n  },\n  ipv4: '127.0.0.1', // optional\n  endpoint: 'http://localhost:4568', // localstack only\n  type: 'BATCH',\n};\n```\n\nCode Example:\n\n```js\nconst events = require('@babbel/miza-kinesis');\n\nconst emitEvent = events(config);\n\nconst events = [\n  {\n    name: 'request:performed',\n    meta: {\n      // ...\n    },\n  },\n  {\n    name: 'data:saved',\n    meta: {\n      // ...\n    },\n  },\n];\n\ntry {\n  const data = await emitEvent(event);\n  console.log(data)\n}\ncatch(error) {\n  console.error(error);\n}\n```\n\nConfig has a following format:\n\n- `appName` - **required** added to the events meta data to give notice of it's origin\n- `kinesisStream.arn` - **required** Kinesis ARN where the events will be send\n- `kinesisStream.httpOptions` - _optional_ specified in AWS SDK https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Kinesis.html\n- `kinesisStream.maxRetries` - **optional** the maximum amount of retries to attempt with a request. See AWS.Kinesis.maxRetries for more information.\n- `config.maxRetries` the maximum amount of retries to attempt for failed requests.\n- `ipv4` - _optional_ ip of the machine that is sending the event\n- `endpoint` - **localstack-only** we recommend to run the service in development environment using Localstack. Kinesis (from Localstack) will respond at the location `http://localhost:4568`. In order to work with Kinesis, you need to provide the location(endpoint) to the AWS-sdk configuration.\n- `partitionKey` - **optional** the key used to group data by shard within a stream.\n\n`emitEvent` returns data in either of the following format: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Kinesis.html#putRecord-property or https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Kinesis.html#putRecords-property\n\n`event` specification you can check here: https://confluence.internal.babbel.com/wiki/display/PM/Event+Specifications\n\n`events` array of events\n\n## Releasing new versions\n\nIn order to create a release:\n\n1. Add details about changes in `CHANGELOG.md`\n1. Version the new changes\n   - Manual version update:\n     1. Update the version in `package.json` of your feature branch\n     1. Tag the last commit with the new version\n        1. `git tag v1.x.x`\n        1. `git push origin v1.x.x`\n   - Automatic version update:\n     1. Use [`npm version`](https://docs.npmjs.com/cli/version)\n1. Merge to master!\n   1. New versions are automatically published to npm on every merge to `master`\n\n## License\n\nMIT Licensed. See [LICENSE](https://github.com/babbel/mize-kinesis/blob/master/LICENSE) for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Fmiza-kinesis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabbel%2Fmiza-kinesis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Fmiza-kinesis/lists"}