0.3.7 • Published 4 months ago

pangocdp-zmalog-sdk v0.3.7

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

Beta Pango Zalo Mini App Log SDK

To make it easy for you to integrate with PangoCDP ZMA Event Log.

Prerequisites

Variables that need to be provided by PangoCDP Team

  • orgId
  • cdpAppId
  • publicKey

🛠️ Install Dependencies

npm

npm install pangocdp-zmalog-sdk

yarn

yarn add pangocdp-zmalog-sdk

🧐 Features

  • Init SDK
  • Follow OA
  • Ingest log to PangoCDP
  • Get User Info (name, avatar, phone number, location)

🧐 Init SDK Variables

NameTypeDescriptionSample
envstringThe environment of log (development, production)development
orgIdstringOrganization ID8e23f11bae7e38478c3d0f99f467bb58
cdpAppIdstringPangoCDP App IDd3dbe129c8259cea103660edcf4d6217-1730875326238
publicKeystringPublic key of PangoCDP App IDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMII....

🧑🏻‍💻 Usage

Create new file instrument.ts

  • Auto event generation: open-app
import * as PangoSDK from 'pangocdp-zmalog-sdk';

PangoSDK.init({
    env: "development",
    orgId: "8e23f11bae7e38478c3d0f99f467bb58",
    cdpAppId: "d3dbe129c8259cea103660edcf4d6217-1730875326238",
    publicKey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQE..."
})

Include the initialization file as the first import statement

import "./instrument";
import App from "./App";
import { createRoot } from "react-dom/client";

const container = document.getElementById(“app”);
const root = createRoot(container);
root.render(<App />);

Follow Offical Account

  • Auto event generation when follow oa: follow-oa
import * as PangoSDK from 'pangocdp-zmalog-sdk';
const data = await PangoSDK.follow()

Ingest event log | Name| Type| Description | -------- | -------- | -------- | | unique | string | Set this event is unique in one session open app | | eventName| string | Name of the event | | eventData | object| Add more data to event |

import * as PangoSDK from 'pangocdp-zmalog-sdk';
PangoSDK.ingest({
    unique: true,
    eventName: "sdk-test",
    eventData: { test: 'hihi' }
})

Get User Info

  • Auto event generation when share phone: allow-phone
  • Auto event generation when share location: share-location
  • Auto event generation when not share: reject-zalo-permission
import * as PangoSDK from 'pangocdp-zmalog-sdk';
const data = await PangoSDK.getInfo(["scope.userLocation", 'scope.userPhonenumber'])
// {success: true, error: "", number: "0123456789", latitude: "10.709926", longitude: "106.709282"}

🙇 Author

vuongnd@bytetech.io

    
0.3.7

4 months ago

0.3.6

4 months ago

0.3.5

4 months ago

0.3.4

4 months ago

0.3.3

4 months ago

0.3.2

4 months ago

0.3.1

4 months ago

0.3.0

4 months ago

0.2.9

4 months ago

0.2.8

4 months ago

0.2.7

4 months ago

0.2.6

4 months ago

0.2.5

4 months ago

0.2.4

4 months ago

0.2.3

4 months ago

0.2.2

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.9

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.6

4 months ago

0.1.5

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago

0.0.9

4 months ago

0.0.8

4 months ago

0.0.7

4 months ago

0.0.6

4 months ago

0.0.5

4 months ago

0.0.4

4 months ago

0.0.3

4 months ago

0.0.2

4 months ago

0.0.1

4 months ago