Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@mediavine/kinesis-client
Advanced tools
Readme
A client for sending data to AWS Kinesis Data Streams without clients-side authentication. This is particularly useful for collecting browser data. The data can then be directed to S3, RedShift, or ElasticSearch.
Use the following role policy when creating the IAM role.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"mobileanalytics:PutEvents",
"cognito-sync:*"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"kinesis:Put*"
],
"Resource": [
"STREAM_RESOURCE_ARN"
]
}
]
}
yarn add @mediavine/kinesis-client
or
npm i @mediavine/kinesis-client
Import and instantiate the client:
import KinesisClient from '@mediavine/kinesis-client'
const options = {
debug: false, // <required> boolean
identityPoolId: '...', // <required> string (AWS Cognito Pool ID)
interval: 5000, // <optional> number (interval in ms for sending batched data)
region: '...', // <required> string (https://docs.aws.amazon.com/general/latest/gr/rande.html)
sendOnBlur: false, // <optional> boolean (send events when page is blurred or closed)
streams: [
{ key: 'k1', name: '...' }, // <required> array<{ key: string, name: string }>
{ key: 'k2', name: '...' } // (AWS Kinesis streams you wish to track)
]
}
// Client can be instantiated normally, but there is will be a small delay
// before AWS Cognito can authenticate.
const client = new KinesisClient(options)
// Client can be initialized asynchronously and will be ready for immediate
// tracking.
KinesisClient.init(options).then((client) => {
// start tracking...
})
Track events using the stream key corresponding to an AWS Data Stream name with the proper authentication settings, allowing the AWS Cognito role to send data to it.
// Add en event to be sent to a Kinesis stream
client.track('k1', { foo: 'bar' })
client.track('k2', { fizz: 'buzz' })
If an interval
options was included in instantiation of the client, data will
be sent automatically at regular intervals. To manually trigger a data batch to
be sent to Kinesis, use the following. It will clear all pending data.
client.send().then((data) => {
// do something with AWS data stream response
})
FAQs
An AWS Kinesis client for event data collection
The npm package @mediavine/kinesis-client receives a total of 0 weekly downloads. As such, @mediavine/kinesis-client popularity was classified as not popular.
We found that @mediavine/kinesis-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.