How to view 2FA backup codes

Hey everyone!
I'm trying to use this method from the 2FA feature of better-auth:
const data = await auth.api.viewBackupCodes({
    body: {
        userId: "user-id",
    },
});

However, the return type of this function is single hex string of code, rather than list of the original codes.
how can I correctly show the original codes to the user?
https://www.better-auth.com/docs/plugins/2fa#viewing-backup-codes
Enhance your app's security with two-factor authentication.
Was this page helpful?