On Credential Revocation Status Changed Event
Invoked when one or more credentials in the user’s wallet have their revocation or suspension status updated on the registry.
-
Purpose: Keep your app’s credential state in sync with the registry. When credentials are revoked or reinstated, you can react by updating UIs, disabling features, or prompting users to re-verify.
-
Functionality: The handler receives a
RevocationStatusChangeModel
with:credentials
(array of Credential objects) – The affected credentials.type
(string) – The kind of status change ('revoked'
or'suspended'
).value
(boolean) – The new status flag (true
if revoked/suspended,false
if reinstated).
-
Usage:
- Log & analyze – Audit which credentials changed and why.
- Validate – Call your verification service to ensure no revoked credentials are used in sensitive flows.
- UI update – Grey out or remove revoked credentials from your credential list.
- Notify user – Show an alert or notification explaining that some credentials are no longer valid.
-
Example:
import { RevocationStatusChangeModel } from '@one37id/mobile-js-sdk';
import { connectionService } from '../services';
const handlers: EventHandlers = {
onCredentialRevocationStatusChanged: async (
model: RevocationStatusChangeModel
) => {
console.log(
`${model.credentials.length} credential(s) changed their ${model.type} status to '${model.value}'.`
);
console.warn('Detected credential revocation.');
// trigger re-validation or UI lock-down
await connectionService.validMdlCredentialExists(
model.credentials
);
// optional: handle re-instated credentials (value === false)
},
};