What is Zalo Kit?
Zalo Kit (react-native-zalo-kit) is a React Native wrapper around the official Zalo SDKs for Android and iOS. With it, your app can:
- sign users in with Zalo, through the Zalo app or the web (Login);
- keep the session fresh, with access tokens refreshed for you (Tokens and sessions);
- read the signed-in user's basic profile (User profile).
Supported APIs
| API | Android | iOS |
|---|---|---|
login | ✅ | ✅ |
getAccessToken / refreshAccessToken | ✅ | ✅ |
isAuthenticated | ✅ | ✅ |
getUserProfile | ✅ | ✅ |
logout | ✅ | ✅ |
getApplicationHashKey | ✅ | ❌ |
Zalo's other social APIs (friends, messages, feed) are no longer available to third-party apps, so Zalo Kit focuses on login and the profile.
Zalo SDK references: Android, iOS.
How it works
login()opens the Zalo app, or Zalo's web login, with a PKCE challenge.- Zalo returns an OAuth code, which Zalo Kit exchanges for an access token and a refresh token.
- The tokens are encrypted and stored on the device.
getAccessToken()andgetUserProfile()reuse them and refresh the access token when it expires.
If your backend needs to verify the user, send it the access token from getAccessToken() and call Zalo's Graph API from the server.
Next steps
- Installation
- Create a Zalo app
- Setup for Expo, iOS or Android