After three weeks of private preparations, Senator Bernie Sanders is expected to endorse Hillary Clinton on Tuesday at a campaign event in New Hampshire, according to three Democrats who have been involved in the planning.

The Clinton campaign on Thursday announced the New Hampshire trip but did not provide details, including any mention of Mr. Sanders.

Mr. Sanders, in an interview Thursday with Bloomberg View’s Al Hunt, came as close to endorsing Mrs. Clinton as he ever has, saying: “We have got to do everything that we can to defeat Donald Trump and elect Hillary Clinton. I don’t honestly know how we would survive four years of a Donald Trump as president.”

The three Democrats, who spoke on the condition of anonymity to reveal confidential conversations, said that the endorsement was partly the result of daily talks between Mrs. Clinton’s campaign manager, Robby Mook, and the Sanders campaign manager, Jeff Weaver, about bringing together the two rivals and advancing the policy priorities of Mr. Sanders. The discussions included a dinner between Mr. Mook and Mr. Weaver in Burlington, Vt., where Mr. Sanders has his campaign headquarters.