According to this interview with Yahoo Movies;
Foster based the novelisation largely on the Kasdan screenplay:
What level of security was required for you to access the script? In my imagination, it involves a flash drive that self-destructs after
They didn’t say that, but then, that would be part of the secrecy! [Laughs] No, there are a couple of systems that studios use now to
send stuff like that. It probably makes the encryption at the NSA look
amateurish. It was sent in pieces to me via email, and it was very,
very secure. I used the same system when I did the novelizations of
J.J.’s two Star Trek movies, so it was quite easy.
He didn't get to see the film in advance but he was shown some of the props, concept art and set photos
Were you at least shown the film in advance?
No, I just saw it on Saturday morning, the day after it opened. Unlike the two Star Trek films, I didn’t get to see the film while I
was writing, which was a shame — it would have made the novelization
even better. It always does! I did get to see a fair number of still
photos of the settings and the characters in costume. I really made a
case for that. I told the studio, “The screenplay describes Rey’s
scavenger outfit as being a certain way, but it would be useful if I
could see the thing instead of having to invent it — pun not intended
— out of whole cloth.” They relented, so I got to see pictures of
devices and sets. For example, the descriptions of Maz Kanata’s
cantina in the book reflects the images I saw, some of which were
completed and some that weren’t.
He didn't speak to Jar Jar Abrams during the writing of the book, not even once.
Did you have any direct contact with J.J. Abrams during the process?
No, I’ve never met J.J. and vice versa. Doing a small film is a 24/7 project, and a film like this more like a 25/7 job. I’ve been on sets
with directors making nine figure-plus films and you’re lucky if you
can get a midnight meeting with them while they’re eating dinner…. I’m
sure we’ll bump into each other one of these days, and talk about
anything other than Star Trek and Star Wars.