those books that were popular a few years back, that had alternate storylines and endings

The Choose-Your-Own-Adventure books are classic examples of ergodic literature (if not classic examples of literature in the more traditional sense!). There are other book-form examples -- there's apparently a Nabokov book where a sort of secondary story is told through the endnotes, which the reader can choose to read or not read.