
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Zalo Mini apps SDK. Contains all methods separated by categories
import apis from 'zmp-sdk;
▸ getAccessToken(): Promise<any>
Get Access Token.
async
function
getAccessToken
example
apis.getAccessToken().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ login(): Promise<any>
Login to call more action.
async
function
Login
example
apis.login().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ getVersion(): string
Get the current version of sdk.
Returns: string
Zalo Mini App version.
▸ clearStorage(option
: ClearStorageDataType): Promise<any>
Clears the data cached locally.
async
function
clearStorage
example
apis.clearStorage({
prefix: "prefix" // optional
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
option | ClearStorageDataType |
Returns: Promise<any>
▸ getStorage(object
: GetStorageDataType): Promise<any>
Asynchronously gets the content of the specified key from the local cache.
async
function
getStorage
example
apis.getStorage({
key: "key",
isPrefix: false
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | GetStorageDataType |
Returns: Promise<any>
▸ getStorageInfo(): Promise<any>
Asynchronously gets the information related to the current storage.
async
function
getStorageInfo
example
apis.getStorageInfo().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
▸ removeStorage(object
: RemoveStorageDataType): Promise<any>
Removes the specified key from the local cache.
async
function
removeStorage
example
apis.removeStorage({
key: 'key'
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | RemoveStorageDataType |
Returns: Promise<any>
▸ setStorage(object
: SetStorageDataType): Promise<any>
Stores data in the specified key in the local cache. This operation will overwrite the original content of the key.
async
function
setStorage
example
apis.setStorage({
key: "key",
data: "value"
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | SetStorageDataType |
Returns: Promise<any>
▸ getNetworkType(): Promise<NetworkTypeSuccessCallback>
Gets the network type.
async
function
getNetworkType
example
zmpApis.getNetworkType().then((res) => {
console.log(res.networkType);
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<NetworkTypeSuccessCallback>
Promise object
▸ setDeviceOrientation(object
: DeviceOrientationType): Promise<any>
Sets the color of the navigation bar in the page.
async
function
setDeviceOrientation
example
apis.setDeviceOrientation({
rotate: 0
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | DeviceOrientationType |
Returns: Promise<any>
▸ setNavigationBarColor(object
: NavBarColorType): Promise<any>
Sets the color of the navigation bar in the page.
async
function
setNavigationBarColor
example
apis.setNavigationBarColor({
color: "#000000"
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | NavBarColorType |
Returns: Promise<any>
▸ setNavigationBarLeftButton(object
: NavBarLeftMenuType): Promise<any>
Dynamically sets the left button of the current page.
async
function
setNavigationBarLeftButton
example
apis.setNavigationBarLeftButton({
buttonType: 1,
confirmToExit: 1,
dialogMessage: 'Bạn có muốn đóng app này không?'
}).then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Name | Type |
---|---|
object | NavBarLeftMenuType |
Returns: Promise<any>
▸ setNavigationBarTitle(object
: NavBarTitleType): Promise<any>
Dynamically sets the title of the current page.
async
function
setNavigationBarTitle
example
apis.setNavigationBarTitle({ title: "Current Page" }).then((res) => { console.log("Success"); }).catch((error) => { console.log("Fail"); });
Name | Type |
---|---|
object | NavBarTitleType |
Returns: Promise<any>
▸ getUserInfo(): Promise<any>
Gets user information
async
function
getUserInfo
example
apis.getUserInfo().then((res) => {
console.log("Success");
}).catch((error) => {
console.log("Fail");
});
Returns: Promise<any>
FAQs
Zalo Mini App SDK
The npm package zmp-sdk receives a total of 508 weekly downloads. As such, zmp-sdk popularity was classified as not popular.
We found that zmp-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.