Hillary Clinton takes responsibility for her loss in the 2016 presidential election – up to a point – in a bombshell new memoir out next week. But she saves plenty of fire for her Democratic challenger Bernie Sanders, former FBI director James Comey and even vice-president Joe Biden.

She also, of course, excoriates the man who beat her, Donald Trump, and forcefully defends the man who cheated on her with an affair that disgraced his presidency, Bill Clinton.

And she mildly scolds Barack Obama.

What Happened reportedly gets as close as anything yet to the real Hillary Clinton beneath the candidate and what led to perhaps the most shocking result in a presidential election in modern times.

Clinton’s take on her campaign, at 494 pages, will be published by Simon & Schuster on 12 September, but CNN said it bought an advance copy from a store in Jacksonville, Florida, and reported on excerpts on Tuesday.

Other extracts, previously broadcast by MSNBC, revealed that Clinton considered telling Donald Trump “Back up, you creep!” during one of the presidential debates. She said her “skin crawled” when he invaded her personal space.

She writes in her new book: “I go back over my own shortcomings and the mistakes we made. I take responsibility for all of them. You can blame the data, blame the message, blame anything you want – but I was the candidate. It was my campaign. Those were my decisions.”

She admits she badly misjudged the environment in which she was running and the candidate she was running against, according to CNN.

She writes: “I think it’s fair to say that I didn’t realize how quickly the ground was shifting under all our feet. I was running a traditional presidential campaign with carefully thought-out policies and painstakingly built coalitions, while Trump was running a reality TV show that expertly and relentlessly stoked Americans’ anger and resentment.”

Clinton recalls the euphoria of her last full day of campaigning. During their final event together, Barack Obama hugged her and whispered, “You’ve got this. I’m so proud of you.” Then in the early hours of 9 November, Obama urged Clinton to concede to Trump, not string things out. The phone call was “one of the strangest moments” of her life.

Clinton at a rally in New Jersey in June last year. Photograph: Spencer Platt/Getty Images

“I congratulated Trump and offered to do anything I could to make sure the transition was smooth,” she writes. “It was all perfectly nice and weirdly ordinary, like calling a neighbor to say you can’t make it to his barbecue. It was mercifully brief. I was numb. It was all so shocking.”

Clinton says sexism hampered her ability to connect with voters. “What makes me such a lightning rod for fury? I’m really asking. I’m at a loss. I think it’s partly because I’m a woman,” she writes. She also admits suffering from an inability to speak her mind on the campaign trail.

She pinpointed her comment during a CNN town hall about putting coal miners out of business as the misstep “I regret the most.” Clinton also reiterated that it was “dumb” of her to use a private email server when she was secretary of state.

But she criticises Sanders, her opponent in the Democratic primaries, who ran her to the wire with a huge wave of popular support behind his calls for a socialist-style revolution.

“He didn’t get into the race to make sure a Democrat won the White House, he got in to disrupt the Democratic party,” she writes. “He isn’t a Democrat. That’s not a smear, that’s what he says. I’m proud to be a Democrat and I wish Bernie was, too.

“Every time I wanted to hit back against Bernie’s attacks, I was told to restrain myself. My team kept reminding me that we didn’t want to alienate Bernie’s supporters. President Obama urged me to grit my teeth and lay off Bernie as much as I could. I felt like I was in a straitjacket.

“Nonetheless, his attacks caused lasting damage, making it harder to unify progressives in the general election and paving the way for Trump’s ‘Crooked Hillary’ campaign.”

She is generous with her praise for many party colleagues and those who campaigned for her. But she questions criticism she received from former vice-president Biden, who is still viewed by some as a contender for 2020.

“Joe Biden said the Democratic party in 2016 “did not talk about what it always stood for – and that was how to maintain a burgeoning middle class,’” Clinton writes. “I find this fairly remarkable, considering that Joe himself campaigned for me all over the midwest and talked plenty about the middle class.”

But it was then-FBI director James Comey’s October revival of her email troubles that holed her campaign below the waterline, she writes, after he wrote a letter telling Congress he was looking into freshly discovered emails relating to her use of a private server while at the state department.

“Comey’s letter turned that picture upside down,” Clinton writes, turning her image from a steady leader to one compromised by scandal.

Meanwhile, during passages about Russia’s meddling in the election, she wonders whether a more forceful public response from then-president Barack Obama could have changed matters.

In her personal life, she describes her marriage to Bill as one with “many, many more happy days than sad or angry ones” and talks at length about their loving relationship, despite hearing time and again even on the 2016 campaign trail that it was “just a marriage on paper now.”

Looking back to the scandals of the 1990s, when he had an affair with White House intern Monica Lewinsky, which led to his impeachment, and accusations by several women of sexual impropriety, she writes: “There were times that I was deeply unsure about whether our marriage could or should survive, but I asked myself the questions that mattered to me: do I still love him? And can I still be in this marriage without becoming unrecognizable to myself – twisted by anger, resentment, or remoteness? The answers were always yes.”