WASHINGTON — This was supposed to have been the week Joe Biden quietly set the wheels of his 2020 candidacy in motion. Then came something of a public trial by fire for his still-unformed campaign team over setting his in-your-space brand of politicking apart from the #MeToo era.

And it all ended with the former vice president all but publicly declaring his candidacy and making it clear he very much intends to run on his own terms.

“We’ll find out whether I can win in a primary,” he said in an impromptu press gaggle Friday after delivering a feisty pitch to union workers in Washington. “I’m an Obama-Biden Democrat man. And I’m proud of it.”

It was barely a week ago that Lucy Flores’ account of an unwelcome, all-too familiar encounter with the then-vice president triggered the kind of crisis that in less frenetic times might have crippled a candidacy before it was fully formed. But by Friday the prevailing sense among Biden’s team was that the experience had left them battle-tested for the campaign to come.

Biden has maintained a small nucleus of trusted advisers, most of whom weathered the storm with him this week at his Virginia home and were operating under a clear directive from him as the week began: full steam ahead. So undeterred was Biden that on Thursday he stuck with plans to travel to his childhood home of Scranton, Pennsylvania, to film what could serve as part of an announcement video.

Sources close to Biden’s tight-knit team say that during a long-planned huddle this week, his political brain trust largely focused on the task at hand — making key strategic calls about the structure and message of his campaign. Biden or other senior officials spoke in some cases multiple times with surrogates and potential staff in key early voting states, shoring up his political organizations there and discussing the potential contours of a post-announcement barnstorming tour.

But managing the fallout from Flores’ allegation and other accounts that would later surface was no easy feat. First, the nature of the charges cut to the core of Biden’s political identity, his “politics-is-personal” credo manifested by years of close-talking, back-slapping, arm-holding retail politics. And for a man who first won an election nearly 50 years ago, there was also the task of handling offers of assistance from his sprawling network of former staff, colleagues and other political allies.

A clear benefit of that extended Biden community was a mostly positive outpouring of testimonials from women he had worked with, mainly on social media, accounting for his character and long record of supporting and empowering women in politics and government. But there was also a lot of friendly, even unsolicited and at times contradictory advice for what to do next, to say nothing of the admonishment for not having been prepared for the line of criticism to begin with.

A pair of initial statements, first from a spokesman and then days later from Biden himself, sought to be respectful of Flores’ experience without acknowledging any wrongdoing. Her subsequent acknowledgment that she did not feel Biden’s conduct rose to the level of assault along with her admission that she raised the issue with his candidacy directly in mind changed the nature of the response — including a forceful attack broadly on “a cottage industry of lies” that had grown online deliberately, in their view, misrepresenting his well-intentioned interactions with the public.

But additional accusations — like Flores’, they stopped short of any claims of assault but were nonetheless unwelcome — required an escalation. A loosely scripted, simply produced video from the former vice president released Wednesday nodded toward contrition, but clearly also sought to reclaim his political brand.

“I never thought of politics as cold and antiseptic. I’ve always thought it about connecting with people,” he said. “I’ll always believe governing, quite frankly — life, for that matter — is about connecting, about connecting with people. That won’t change, but I will be more mindful and respectful of people’s personal space.”

The unplanned video post did give Biden’s team an unexpected chance to measure his resonance and reach on social media, with heartening results. By Thursday evening, the Twitter video had nearly 5.7 millions views. By comparison, only Bernie Sanders’ announcement video had more views on Twitter at just under 7.5 million. Beto O’Rourke’s announcement video had 5.1 million views on the platform, followed by Kamala Harris (4.3 million), Cory Booker (4.1 million) and Elizabeth Warren (3.8 million).

A doctored version of Biden’s video posted by President Donald Trump had more than 7 million views in an even shorter period of time. Trump himself dismissed Biden’s candidacy Friday as not a threat. To Biden’s allies, it only served to illustrate a contrast between the two men that they feel ultimately serves the Democrat well.

“I think when Americans hear from Joe Biden, what they hear is heart and integrity and seriousness. Concern about our country and concern about our future," said Sen. Chris Coons, D-Del. "What I think they hear when they see President Trump going on Twitter attacking people, making up nicknames for everyone, going after other families, is just someone who doesn't reflect the best in the American spirit."

Aides didn’t intend for Biden to address the issue any further Friday as he made his first public appearance in nearly two weeks, at the International Brotherhood of Electrical Workers conference in Washington. But Biden, who’d just assured the public “I get it,” seemed to all-too-glibly make light of the week’s drama as he accepted the warm embrace of IBEW President Lonnie Stephenson.

"I just want you to know, I had permission to hug Lonnie,” he said after taking the stage.

Biden then unexpectedly addressed reporters to make clear it “wasn’t my intent to make light of anyone’s discomfort.”