@bilyai/js
TypeScript icon, indicating that this package has built-in type declarations

1.0.32 • Public • Published

Official Bily SDK for Browser

npm version npm dm npm dt

Don't already have an account and store added ? Head over to Bily, then return to this page.

☕ Install package

npm install @bilyai/js
yarn add @bilyai/js

🚦 Configurations

Configuration should happen as early as possible in your application's lifecycle.

import { init } from '@bilyai/js';

init('https://b.magnetor.net');

Once implemented, Bily's JavaScript SDK will automatically track all pageviews. You can now begin tracking all other events as well.

🚀 Start tracking events

import { track } from '@bilyai/js';

track('Product Viewed', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    // ... other attributes here
  },
  products: [
    {
      id: '123',
      name: 'Product 1',
      price: 100,
      quantity: 1,
      currency: 'USD',
      sku: '123',
      category: 'Category 1',
      brand: 'Brand 1',
    },
  ],
  // ...other attributes here
});
import { track } from '@bilyai/js';

track('Product Added', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    // ... other attributes here
  },
  products: [
    {
      id: '123',
      name: 'Product 1',
      price: 100,
      quantity: 1,
      currency: 'USD',
      sku: '123',
      category: 'Category 1',
      brand: 'Brand 1',
    },
  ],
  // ...other attributes here
});
import { track } from '@bilyai/js';

track('Checkout Started', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    email: 'john@doe.com',
    // ... other attributes here
  },
  products: [
    {
      id: '123',
      name: 'Product 1',
      price: 100,
      quantity: 1,
      currency: 'USD',
      sku: '123',
      category: 'Category 1',
      brand: 'Brand 1',
    },
  ],
  // ...other attributes here
});
import { track } from '@bilyai/js';

track('Order Completed', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    email: 'john@doe.com',
    phone: '1234567890',
    gender: 'male',
    dateOfBirth: '1990-01-01',
    address: {
      city: 'New York',
      state: 'NY',
      country: 'US',
      zip: '10002',
    },
    // ... other attributes here
  },
  order: {
    id: '123',
    currency: 'USD',
    total: 100,
    products: [
      {
        id: '123',
        name: 'Product 1',
        price: 100,
        quantity: 1,
        currency: 'USD',
        sku: '123',
        category: 'Category 1',
        brand: 'Brand 1',
      },
    ],
  },
  // ...other attributes here
});

If you get stuck, shoot us an email or use the Intercom widget on the bottom right of any page.

We're excited you're here! :blue-heart:

This won't be fun to clean up...

Readme

Keywords

none

Package Sidebar

Install

npm i @bilyai/js

Weekly Downloads

5

Version

1.0.32

License

ISC

Unpacked Size

11.6 kB

Total Files

5

Last publish

Collaborators

  • dearbily
  • babacar.basse