open-index/open-npm huggingface dataset:
npm package: @real2u/analytics
Description: Real-time data processing analytics
Latest version: 1.1.0

# Analytics

Real-time data processing analytics 

Based on
https://aws.amazon.com/getting-started/projects/build-serverless-real-time-data-processing-app-lambda-kinesis-s3-dynamodb-cognito-athena/4/

### Example

```javascript
// initalize
const analytics = new Analytics({
  cognito: {
    identityPoolId: 'us-east-1:abcdefab-abcd-abcd-abcd-abcdefabcdef'
  },
  kinesis: {
    streamName: 'AnalyticsStream'
  }
})
// set dimension values
analytics.set('sku', 'RE000001')
// predefined metric
analytics.send({
  [analytics.dimensions.add_to_cart]: 1
})
// custom metric
analytics.send({
  'element': 'color_button',
  'click': 1
})
```