lucia-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

Commitizen-friendly

Lucia JavaScript Library

The Lucia JavaScript Library is a set of methods attached to a global LuciaSDK object intended to be used by websites wishing to send data to Lucia Ad Attribution.

Installation

Install via npm

You can use npm or yarn to install this library:

npm install lucia-sdk

or

yarn add lucia-sdk

Install via CDN

You can add the following script to use global LuciaSDK object.

<script src="https://cdn.luciaprotocol.com/lucia-sdk-latest.min.js"></script>

Usage

Initialize the SDK

LuciaSDK.init({
  apiKey,
});

Track events

Page views, conversions, and user information can be tracked using the following methods:

LuciaSDK.userInfo('john@email.com', {
  //user details
  first_name: 'John',
  last_name: 'Doe',
  phone: '123-456-7890',
});

LuciaSDK.pageView('landing-page');

LuciaSDK.trackConversion(
  'purchase', // event tag
  500, // amount
  {
    //event details
    product_id: 'bag_123',
    quantity: 1,
    brand: 'Nike',
  },
);

LuciaSDK.buttonClick('cta-button');

LuciaSDK.sendWalletInfo('0x1234567890', 59141);

Readme

Keywords

none

Package Sidebar

Install

npm i lucia-sdk

Weekly Downloads

26

Version

0.4.0

License

CC-BY-NC-4.0

Unpacked Size

1.06 MB

Total Files

28

Last publish

Collaborators

  • akrajguru
  • lmeng-lp
  • dmty
  • lucia-bsears