Creates a kine client. You must provide a stream name and the region where the stream resides. You can also provide the name of the dynamodb table that kine will use for tracking shard leases and checkpointing progess.
If you do not explicitly pass credentials when creating a kine client, the aws-sdk will look for credentials in a variety of places. See the configuration guide for details.
Parameters
options
object configuration parametersoptions.region
string the region in which the default stream residesoptions.shardIteratorType
string where to start in the stream.LATEST
orTRIM_HORIZON
options.table
string the dynamodb table to use for tracking shard leases.options.init
function function that is called when a new lease of a shard is startedoptions.processRecords
function function is that called when new records are fetches from the kinesis shard.options.maxShards
[string] max number of shards to track per process. defaults to 10options.limit
[string] limit used for requests to kinesis for the number of records. This is a max, you might get few records on process recirdsoptions.streamName
string the name of the kinesis stream to consumeoptions.endpoint
[string] the kinesis endpoint urloptions.dynamoEndpoint
[string] the dynamodb endpoint urloptions.sessionToken
[string] credentials for the client to utilizeoptions.accessKeyId
[string] credentials for the client to utilizeoptions.secretAccessKey
[string] credentials for the client to utilizeoptions.sessionToken
[string] credentials for the client to utilizeoptions.cloudwatchNamespace
[string] namespace to use for custom cloudwatch reporting of shard ages. required ifcloudwatchStackname
is setoptions.cloudwatchStackname
[string] stack name to use as a dimension on custom cloudwatch reporting of shard ages. required ifcloudwatchNamespace
is setoptions.maxProcessTime
[string] max number of millseconds between getting records before considering a process a zombie . defaults to 300000 (5mins)
config
Examples
var Kine = require('kine');
var kine = Kine({
streamName: 'my-kinesis-stream',
region: 'us-east-1'
});
Returns client a kine client