I used code from the example
unsplash.auth.userAuthentication(query.code) .then(toJson) .then(json => { unsplash.auth.setBearerToke