In my opinion, the books are just as good as any screen material and should be considered canon and the "real" story line.
Canon has nothing to do with good or bad. It's not a value judgment. It's simply a matter of what's feasible to keep consistent. It's difficult enough for the various different producers of the TV/film franchise to keep consistent with one another's creations and ideas, and in fact the franchise is fraught with inconsistencies as it is. But for a TV/film franchise to keep consistent with a set of books that are produced on a very different schedule, written by people scattered all over the English-speaking world, edited by people on the other end of the continent, and read by only a tiny fraction of the TV/film viewing audience would be vastly more difficult and impractical. The only times that book or comic tie-ins have ever been able to function as truly canonical works have been when the creators of the TV franchise have been able to supervise or write the tie-ins themselves.