With five One Direction albums and two solo records under his belt, anything smaller than an arena show has become a rarity for Harry Styles, so a clandestine club show in the hipster capital of Brooklyn is, obviously, a one-off. Just as much as the crowd that was packed into the Music Hall of Williamsburg Friday night, Styles seemed to be having the time of his life, even if all that mutual ecstasy was packed into a five-song mini-show.

The occasion was a Sirius XM + Pandora Secret Session, which also included an onstage interview with SiriusXM’s “The Morning Mashup,” in which Styles talked about, among other things, his love for Lizzo. But the true juice of the undercover appearance was an intimate performance that began with Styles whipping his head back and forth with his characteristic rock star swagger, thrusting a bottle of Jaden Smith’s Just Water at the crowd as if it were holy water.

Styles has described his latest album, “Fine Line,” as being about “having sex and feeling sad.” Only one of these two entered into the equation — figuratively — in the Williamsburg gig, and it was assuredly not the melancholy part. Styles commanded the stage whether he was simply owning his signature Jagger-esque dance moves or twirling with the Pride flag during a rock ’n’ roll rendition of the One Direction classic “What Makes You Beautiful.”

Then there was the assertiveness of his vocals when he yearned for “more berries” with his seductive smile during the funk-pop “Watermelon Sugar.” There’s also the unbreakable connection Styles has with his fans: The crowd seamlessly joined in on the recent album’s lead single, “Lights Up,” as if they’d recorded it together from the start. But his irresistibly syrupy way of intoning “Oh honey,” during a low-octave rendition of “Adore,” quickly served as a reminder that he’s even more commanding outside of sing-along mode.

Styles had no qualms about toying with his fans: “Want your hat back? Shouldn’t have thrown it on stage. Them’s the rules!” He had the whole audience sing “Happy Birthday” to a friend and quip that they’re 27 when they’re actually decades older. Playfulness turned to liberation when he performed his technicolor rock anthem “Kiwi,” convulsing and swaying in his own universe. 

During the preliminary on-stage interview, Styles addressed everything from his recent trip to a Wawa in Delaware (much to the audience’s dismay, Styles didn’t reveal his favorite Wawa hoagie) to potentially working with Lizzo, whom he praised Lizzo for having an “infectious positivity.” He also addressed whether or not he’d collaborate with her.

Addressing his recent performance of “Juice” with Lizzo in Miami, “It’s funny because any time people like when two people perform together, everyone thinks, ‘You should do a song together.’ It’s fine, but it’s also fine for people to just like it” in the live moment, he said. He added that “if there was ever a time when it made sense for us to [make a song together], then absolutely [I’d do it].”

But at the moment, Styles is busy enough, with a Love on Tour international arena tour on deck for the summer, where he’ll no doubt ramp up the production design elements and uses his stage as a canvas, even if 650 fans in Brooklyn can vouch that he thrills with zero frills.