Backup codes generated at time of 2FA setup. Offer download button to store 10 auto-generated backup codes as plaintext file in downloads folder. Ask user to use an a code before they are allowed to enable 2FA to ensure they have the codes. Allow new codes to be generated whenever thereafter they are logged-in.
As the code above can be backed up and allow users to regain access to their account, adding the 10 auto-generated codes seems redundant and unnecessary dev work.
It is for when you don’t have your OTP code generating device, sometimes you might still need access and writing down the seed or the backup code are equally secure.