amplify-js: Cannot use autotrack with AWS Kinesis

Describe the bug Cannot use autotrack with AWS Kinesis

To Reproduce Steps to reproduce the behavior:

  1. Setup Analytics with Kinesis
  2. Setup session and/or pageview autotrack

Expected behavior Sessions and/or Pageviews should appear in Kinesis dashboard

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: All
  • Browser: All
  • Version: 1.2.25

Additional context Works with AWS Pinpoint provider

[DEBUG] 55:07.394 AWSKineisProvider - configure Analytics {disabled: undefined}
ConsoleLogger.js:111 [DEBUG] 55:07.395 AnalyticsClass - configure Analytics {streamName: "test-stream", AWSKinesis: {…}}
ConsoleLogger.js:111 [DEBUG] 55:07.395 AWSKineisProvider - configure Analytics {disabled: undefined, streamName: "test-stream", region: "us-west-2", bufferSize: 1, flushSize: 1, …}
ConsoleLogger.js:111 [DEBUG] 55:07.396 Hub - Dispatching to analytics with  {event: "configured", data: null, message: "The Analytics category has been configured successfully"}
ConsoleLogger.js:111 [DEBUG] 55:07.396 Analytics - on hub capsule analytics {event: "configured", data: null, message: "The Analytics category has been configured successfully"}
ConsoleLogger.js:111 [DEBUG] 55:07.396 AnalyticsClass - current configuration {streamName: "test-stream", AWSKinesis: {…}, autoSessionRecord: true}
ConsoleLogger.js:111 [DEBUG] 55:10.316 AWSKineisProvider - set credentials for analytics undefined
ConsoleLogger.js:111 [DEBUG] 56:38.604 AWSKineisProvider - set credentials for analytics {accessKeyId: "...", sessionToken: "...", secretAccessKey: "...", identityId: "...", authenticated: true}
ConsoleLogger.js:111 [DEBUG] 56:38.604 AWSKineisProvider - set credentials for analytics {accessKeyId: "...", sessionToken: "...", secretAccessKey: "...", identityId: "...", authenticated: true}
ConsoleLogger.js:101 [DEBUG] 56:42.577 AWSKineisProvider - no change for analytics config, directly return from init
ConsoleLogger.js:101 [DEBUG] 59:00.122 AWSKineisProvider - no change for analytics config, directly return from init

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 7
  • Comments: 16 (9 by maintainers)

Most upvoted comments

For anyone who’s trying to make this work, after spending some time putting together a change to the amplify libraries, I realized all we need to do is create a simple wrapper around the AWSKinesisProivder, which we can use without modifying amplify-js because the library is designed to allow provider plugins. I was able to see events coming from my react-js app appearing live in a zeppelin notebook via the Kinesis Studio Notebooks using this approach.

My typescript implementation is here, tried to add lots of comments to explain usage: https://gist.github.com/justro/f72618744d96d9b26acedbb6a711f530

I think someone should make a pull request to edit the docs saying that autotrack does not work for Kinesis so people don’t get confused as it seems like this very important feature is being overlooked.