1.0.20 • Published 22 days ago

@maxzima/wa-communicator v1.0.20

Weekly downloads
-
License
MIT
Repository
-
Last release
22 days ago

Import communicator modules

Import all

import {
  Communicator,
  AccountTracker,
  CommunicatorUpdateChallengeCustomErrorCodeEnum,
  CommunicatorVerifyChallengeCustomErrorCodeEnum,
  CommunicatorEmailCustomErrorCodeEnum,
  TChallenge,
  TCreateSessionResponse,
  TResponse,
  TSetupChallengeResponse,
  TSignInByMobileResponse,
  TVerifyChallengeResponse,
  TGetCurrentUserProfileResponseUser
} from "@maxzima/wa-communicator/dist";

Import only Communicator

import {
  Communicator,
  CommunicatorUpdateChallengeCustomErrorCodeEnum,
  CommunicatorVerifyChallengeCustomErrorCodeEnum,
  CommunicatorEmailCustomErrorCodeEnum,
  TChallenge,
  TCreateSessionResponse,
  TResponse,
  TSetupChallengeResponse,
  TSignInByMobileResponse,
  TVerifyChallengeResponse,
  TGetCurrentUserProfileResponseUser
} from '@maxzima/wa-communicator/dist';

Import only AccountTracker

import {
  AccountTracker,
} from '@maxzima/wa-communicator/dist';

Usage Sender

const communicator = new Communicator({
  clientAuthApiBaseUrl: 'https://api-auth.google.com/v1/',
  clientFAPIBaseUrl: 'https://api-frontend.google.com/v1/',
});

communicator.signIn({
  phoneNumber: '+18004397566',
})
  .then((response) => callback(response));

communicator.setupChallenge({
  type: 'email_otp',
  authToken: 'some_auth_token...',
})
  .then((response) => callback(response));

communicator.verifyChallenge({
  type: 'email_otp',
  code: '123456',
  authToken: 'some_auth_token...',
})
  .then((response) => callback(response));

communicator.emailUpdate({
  email: 'exampleEmail.gmail.com',
  authToken: 'some_auth_token...',
})
  .then((response) => callback(response));

communicator.createSession({
  authToken: 'some_auth_token...',
})
  .then((response) => callback(response));

communicator.signUp({
  locale: 'en',
  phoneNumber: '+18004397566',
  timezoneName: 'Asia/Qatar',
})
  .then((response) => callback(response));

communicator.registration({
  accessToken: 'some_access_token...',
  name: 'companyName',
  hash: 'some_tracking_hash...',
  deviceType: 'mobile',
  gaId: 'gaId_cookie_value',
  origin: 'business',
})
  .then((response) => callback(response));

communicator.getCurrentUserProfile({
  accessToken: 'some_access_token...',
})
  .then((response) => callback(response))

Usage AccountTracker

const tracker = new AccountTracker({
  origin: 'business',
  gtag: window.gtag, // gtag script width ga4_id 
  lintrk: window.lintrk, // lintrk script with _linkedin_partner_id
  ga4Id:'some_ga4_id',
});

/* tracking after sending phone number */
tracker.sendPhoneVerifyEvent();

/* tracking after email verification */ 
tracker.sendEmailVerifyEvent();

/* tracking after registration */ 
tracker.sendRegistrationSuccessEvent();
1.0.20

22 days ago

1.0.19

24 days ago

1.0.18

24 days ago

1.0.17

24 days ago

1.0.16

3 months ago

1.0.15

3 months ago

1.0.14

3 months ago

1.0.13

3 months ago

1.0.12

4 months ago

1.0.11

5 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

8 months ago

1.0.10

6 months ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago