Commands
Get Permissions
This command lets you check the status of permissions a user has granted to your mini app.
Using the command
Currently this command only supports notifications.
Async handlersEvent listeners
Sending the command and handling the response
import { MiniKit, GetPermissionsPayload, Permission } from '@worldcoin/minikit-js'
// Example function of how to use the command
const getPermissions = useCallback(
async () => {
const payload = await MiniKit.commandsAsync.getPermissions();
// Handle the response
},
[]
);
Response type
Success response payload
type MiniAppGetPermissionsSuccessPayload = {
status: 'success';
permissions: Permission[];
version: number; // same version that was received from MiniKit
};
{
"permissions": {
"notifications": false
},
"status": "success",
"timestamp": "2025-03-11T18:21:49.741-07:00",
"version": 1
}
Error response payload
type MiniAppGetPermissionsErrorPayload = {
status: 'error'
error_code: GetPermissionsErrorCodes
version: number
}
The possible error codes are:
generic_error
- Request failed for unknown reason