These tools cover the technical layer. Your privacy policy, data processing agreements, and response timelines are your responsibility.
Setup
lib/kavach.ts
Export user data
POST /auth/gdpr/export
Returns a JSON bundle of all data KavachOS holds for the authenticated user: profile, sessions, audit events, and any plugin-specific records.
Request export (client)
downloadUrl that expires after 24 hours instead of embedding the full payload.
Delete account
POST /auth/gdpr/delete
Permanently deletes the user account and all associated data. Sessions are revoked immediately. If requireDeletionConfirmation is true, the user must provide their password (or a confirmation token sent by email):
Delete account (client)
onBeforeDelete hook
lib/kavach.ts
Anonymize audit log
For cases where you need to retain audit records for compliance but cannot keep personal data, KavachOS can anonymize the audit log for a user without deleting it:Anonymize audit log (server)
Configuration reference
boolean
default:"true"
Require the user’s password before processing a deletion request.
Async callback invoked before the user record is deleted. Use this to clean up app-level data.
'json' | 'url'
default:"'json'"
Format for the data export response. ‘json’ returns inline data, ‘url’ returns a signed download URL.