JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q27376F
  • License MIT

The JavaScript snippet for Chameleon

Package Exports

  • snippet.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (snippet.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Chameleon snippet.js

Build Status Circle CI Code Climate
npm version

#Getting started

Use it

  1. Copy index.min.js
  2. Replace {{ACCOUNT_ID}} with yours from the Chameleon dashboard.
  3. Include it on all HTML pages (before the closing </head> tag)
  4. Include it only in production (even if you have a staging and/or test instances).
  5. For all private pages, call chmln.setup(userProperties)
  6. Deploy the app

chmln.setup spec

The chmln.setup call specifies a user identity that you reference across the user's lifetime. Every chmln.setup call must have a user id (UID) and time that the user was created.

Property Description
uid - required A unique identifier for the user in your database.
created - required The date the user's account was first created. Any date format will work.
email - recommended The email address of the user
plan - recommended Which plan a user falls under (i.e gold, startup, enterprise)
role - recommended The specific type of tasks this user can perform (i.e. owner, admin, member, billing)
spend - recommended The amount of monthly revenue generated by the user's account
  • Recommended properties are optional but are valuable.

Examples

Setup with email, plan and role properties:

chmln.setup({uid: user.id, created: user.createdAt, email: user.email, plan: 'gold', role: 'admin'});