Since the encryption key is basically derived from your password, Notesnook allows you to backup the encryption key.
This encryption key + a random salt is used to encrypt all the data client-side.
In case you forget your password but have the encryption key somewhere safe, you can easily use the encryption key to have your data decrypted.
Notesnook does the above by sending a recovery link to your email. After you click on the email, it authenticates you for a short period of time (30m) and shows the recovery UI. You can put your recovery key in the input. The app downloads the encrypted data from the server, decrypts using the key you gave, and if successful, asks you for a new password. Once you give the new password, it re-encrypts everything using the new encryption key.
All this happens in 2 steps. You can try it out yourself.