3.1.0 • Published 10 months ago

zmp-developer-token v3.1.0

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

Zalo Mini App Developer Token

If you're tired of copying the access token every 1 hour, this library is for you

Setup

npm install -D zmp-developer-token

Usage

import { getDeveloperAccessToken } from "zmp-developer-token";
import api from "zmp-sdk";

async function getAccessToken() {
  await api.login();
  let token = await api.getAccessToken();
  if (token === "DEFAULT ACCESS TOKEN") {
    token = await getDeveloperAccessToken();
  }
  return token;
}

If you have multiple mini apps inside one domain, specify a unique namespace:

await getDeveloperAccessToken("my-app");

How does it work?

You need to provide a valid App ID (which provides the access token), App Secret (to get new tokens) and an initial Refresh Token (which will last many months, and keep renewed automatically until you lost it).

localStorage.setItem("zdt.appId", "");
localStorage.setItem("zdt.appSecret", "");
localStorage.setItem("zdt.refreshToken", "");

Only execute the above scripts inside Devtools > Console. Do not put it inside of your source code ☠️

License

Copyright (c) Zalo Group. and its affiliates. All rights reserved.

The examples provided by Zalo Group are for non-commercial testing and evaluation purposes only. Zalo Group reserves all rights not expressly granted.

3.1.0

10 months ago

3.0.0

10 months ago

2.3.0

1 year ago

2.2.0

1 year ago

2.5.0

1 year ago

2.10.0

1 year ago

2.4.0

1 year ago

2.7.0

1 year ago

2.6.0

1 year ago

2.9.0

1 year ago

2.8.1

1 year ago

2.8.0

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

2.8.2

1 year ago

1.19.0

2 years ago

1.18.0

2 years ago

1.17.0

2 years ago

1.16.0

2 years ago

1.15.0

2 years ago

1.14.0

2 years ago

1.13.0

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.10.0

2 years ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago