Created
September 5, 2022 23:39
-
-
Save erayalakese/eff9f062e8a728576627a0dac0e72ce2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { KinesisClient, PutRecordsCommand } = require("@aws-sdk/client-kinesis"); | |
const kinesisClient = new KinesisClient({ | |
region: "eu-central-1" | |
}); | |
(async function() { | |
const recordData = [ | |
{ | |
Data: Buffer.from(JSON.stringify({ | |
name: "cta-clicked", | |
time: new Date() | |
})), | |
PartitionKey: 'SERVICE_NAME' // Must be a string. | |
} | |
] | |
const data = await kinesisClient.send(new PutRecordsCommand({ | |
Records: recordData, | |
StreamName: 'events' | |
})); | |
console.log(data) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment