1.24.0 • Published 3 years ago

panthera-hubspot-package v1.24.0

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
3 years ago

Panthera Hubspot Wrapper

Simplifying the usage of Hubspot for Panthera Platform

Usage

First you need to initialize instance of hubspot by passing API_KEY to it

import { CRM } from "panthera-hubspot-package";

const crm = new CRM(HUBSPOT_API);

After it's initialized following methods are avaliable:

Create Player

Interface:

interface CreatePlayer {
  uuid: string;
  firstName: string;
  lastName: string;
  email: string;
  dob: string;
  country: string;
  city: string;
  currency: string;
  address: string;
  token: string;
  locale: string;
  username?: string;
  kycStatus?: boolean;
  sex?: string;
  marketingTag?: string;
  isVerified?: boolean;
  loginStatus?: boolean;
  phoneNumber?: string;
  referral?: string;
  bonusCode?: string;
  hasBonusActive?: boolean;
  consent?: boolean;
}

Example usage:

const hubspot = await crm.createPlayer({
  ...player,
  locale: locale.name, // String
});

Example Response:

{
  "id": 1,
  "properties": {
    "address": "Test Street 122",
    "bonuscode": null,
    "city": "Test",
    "consent": "true",
    "country": "Test",
    "createdate": "2021-04-27T13:45:21.570Z",
    "date_of_birth": "1995-03-22T20:40:32.000Z",
    "email": "test@test.com",
    "firstname": "Test",
    "has_bonus_active": "false",
    "hs_is_unworked": "true",
    "hs_marketable_status": "false",
    "hs_marketable_until_renewal": "false",
    "is_verified": "false",
    "kycstatus": "false",
    "lastmodifieddate": "2021-04-27T13:45:21.570Z",
    "lastname": "Test",
    "locale": "en_US",
    "login_status": "false",
    "marketing_tag": "test",
    "phone": null,
    "referral": null,
    "sex": "Not Specified",
    "token": "uuidv4",
    "username": "test_username",
    "uuid": "uuidv4"
  },
  "createdAt": "2021-04-27T13:45:21.570Z",
  "updatedAt": "2021-04-27T13:45:21.570Z",
  "archived": false
}

Update Player

Interface:

interface UpdatePlayer {
  uuid?: string;
  firstName?: string;
  lastName?: string;
  email?: string;
  dob?: string;
  country?: string;
  city?: string;
  address?: string;
  token?: string;
  locale?: string;
  username?: string;
  kycStatus?: boolean;
  sex?: string;
  marketingTag?: string;
  isVerified?: boolean;
  loginStatus?: boolean;
  depositAmount?: number;
  phoneNumber?: string;
  referral?: string;
  bonusCode?: string;
  hasBonusActive?: boolean;
  consent?: boolean;
}

Example usage:

const { error } = await crm.updatePlayer(player.crmReference, {
  ...player,
  locale: player.locale.name,
});
const { error } = await crm.updatePlayer(player.crmReference, {
  loginStatus: true,
  lastLoginTime: new Date(),
});
const { error } = await crm.updatePlayer(player.crmReference, {
  depositAmount: 200,
});

Example Response:

{
  "id": 1,
  "properties": {
    "address": "Test Street 122",
    "bonuscode": null,
    "city": "Test",
    "consent": "true",
    "country": "Test",
    "createdate": "2021-04-27T13:45:21.570Z",
    "date_of_birth": "1995-03-22T20:40:32.000Z",
    "email": "test@test.com",
    "firstname": "Test",
    "has_bonus_active": "false",
    "hs_is_unworked": "true",
    "hs_marketable_status": "false",
    "hs_marketable_until_renewal": "false",
    "is_verified": "false",
    "kycstatus": "false",
    "lastmodifieddate": "2021-04-27T13:45:21.570Z",
    "lastname": "Test",
    "locale": "en_US",
    "login_status": "false",
    "lastLoginTime": "2021-04-27T13:45:21.570Z",
    "marketing_tag": "test",
    "phone": null,
    "referral": null,
    "sex": "Not Specified",
    "token": "uuidv4",
    "username": "test_username",
    "uuid": "uuidv4"
  },
  "createdAt": "2021-04-27T13:45:21.570Z",
  "updatedAt": "2021-04-27T13:45:21.570Z",
  "archived": false
}

Installation

npm i panthera-hubspot-package
1.24.0

3 years ago

1.23.0

3 years ago

1.22.0

3 years ago

1.21.0

3 years ago

1.20.0

3 years ago

1.19.0

3 years ago

1.18.0

3 years ago

1.17.0

3 years ago

1.16.0

3 years ago

1.15.0

3 years ago

1.14.0

3 years ago

1.13.0

3 years ago

1.12.0

3 years ago

1.11.0

3 years ago

1.10.0

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago