npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-sdk-mobile-analytics

v0.9.2

Published

AWS Mobile Analytics SDK for JavaScript

Downloads

347

Readme

Amazon Mobile Analytics SDK for JavaScript

Developer Preview: We welcome developer feedback on this project. You can reach us by creating an issue on the GitHub repository or posting to the Amazon Mobile Analytics forums:

  • https://github.com/aws/aws-sdk-mobile-analytics-js
  • https://forums.aws.amazon.com/forum.jspa?forumID=174

Introduction

The Mobile Analytics SDK for JavaScript allows JavaScript enabled applications to create and submit events for analysis in the AWS Console and through Auto Export to S3 and Redshift. The library uses the browser's local storage API to create a local cache for the data, allowing your web application to batch and record events even when the app is offline.

Setup

  1. Download and include the AWS JavaScript SDK (minimum version 2.1.18):
  • http://aws.amazon.com/sdk-for-browser/
  1. Download and include the Amazon Mobile Analytics SDK for JavaScript:

Usage

Step 1. Log in to the Amazon Mobile Analytics management console and create a new app. Be sure to note your App Id and Cognito Identity Pool Id.

  • https://console.aws.amazon.com/mobileanalytics/home/?region=us-east-1

Step 2. Initialize the credentials provider using a Cognito Identity Pool ID. This is necessary for the AWS SDK to manage authentication to the Amazon Mobile Analytics REST API.

Step 3. Instantiate the Mobile Analytics Manager, including your App ID generated in Step 1, above. Session events will be automatically recorded and the client will batch and automatically submit events to Amazon Mobile Analytics every 10 seconds.

To manually force an event submission you can call:

Additional Options

Custom Events

You can optionally add custom events to capture additional information you find valuable.

Session Settings

By default a session lasts 10 minutes. You can override this default setting when initializing the Mobile Analytics Manager by including "sessionLength" in the "options" object.

A session's timeout can also be updated to allow for continuation of a session.

Record Monetization Event

You can record monetization events to enable reports such as Average Revenue Per User (ARPU) and more.

Add App Details to Events

Additional app and environment details can be added to the "options" object when initializing the SDK. These details will be captured and applied to all events and can be useful if using Auto Export for custom analysis of your data.

Please note, if device details are not specified Amazon Mobile Analytics will make best efforts to determine these values based on the User-Agent header value. It is always better to specify these values during initialization if they are available.

Further Documentation

Further documentation and advanced configurations can be found here:

https://aws.github.io/aws-sdk-mobile-analytics-js/doc/AMA.Manager.html

Network Configuration

The Amazon Mobile Analytics JavaScript SDK will make requests to the following endpoints

  • For Event Submission: "https://mobileanalytics.us-east-1.amazonaws.com"
  • For Cognito Authentication: "https://cognito-identity.us-east-1.amazonaws.com"
    • This endpoint may change based on which region your Identity Pool was created in.

For most frameworks you can whitelist both domains by whitelisting all AWS endpoints with "*.amazonaws.com".

Change Log

v0.9.2:

  • Bug Fixes:
    • Fixed data loss issue on migration from previous versions

v0.9.1:

  • Updated Dependency: aws-sdk-js v2.2.37
  • Increase base delay between retries from 30ms to 3s
  • Allow passing of configurations to the low level client via clientOptions attribute
  • Local events from different apps are stored in different locations
  • Improved retry strategies
  • CorrectClockSkew is enabled by default for Sigv4 Signatures per Issue#7
  • Bug Fixes:
    • Fixed timer from being killed in cases where multiple submissions happened in under a second
    • Fixed duplicate batch re-submission to the Mobile Analytics service
    • Fixed delayed auto-submission of first _session.start event
    • Fixed Safari throwing exception when in private browsing mode

v0.9.0:

  • Initial release. Developer preview.