SHE might be only 27 and with just one film to her name, but if the art of good documentary making is timing, then Alison Klayman is an old master already.

Her film, Ai Weiwei: Never Sorry, is about to be released in the UK just as its subject is making headlines once more.

Ai Weiwei is the Chinese artist and activist who uses his work and the internet to rattle the Beijing authorities. Arrested last year on tax charges, he has since been released and told that his appeal against a $2.4 million fine for tax evasion has been turned down. Ai rejects the charges and says he is being punished for speaking out against the regime.

When he was arrested, Klayman, who filmed him from 2008-2011, was back home in New York. It was 11pm locally, morning in Beijing, so she took immediately to Ai's domain, the internet, to find out what was happening. After a long night of Skyping and Twitter, the journalist found herself at the centre of the information chain, getting reliable information in and out.

"Though I was in New York, in some ways I had better information than other people in Beijing because information doesn't travel that openly there." It was, she concedes, "a crazy night".

But then making a film about Ai was never likely to make for any dull moments. It's a story many would like to have landed. Klayman won it through hard work, persistence and – that timing thing again – being in the right city at the right time.

She had gone to China after graduation with a friend who had family there. When the friend left, Klayman stayed on. A lot of "interesting" jobs followed, such as teaching piano and working in a radio station. That was how she learned to speak Chinese. That skill, in turn, got her a job as an assistant to Crystal Liu on the action adventure film The Forbidden Kingdom. The 2008 movie also starred Jackie Chan.

Although Liu could speak English, her mother and assistant could not. It was another opportunity for Klayman to hone her language skills. "I would say they were two of my primary Chinese teachers during my five months on location. And a little bit of ribbing from Jackie Chan also."

After the film work a friend curating an exhibition of Ai's photographs suggested Klayman do a video to accompany the show. Slowly, Klayman became part of the scene around Ai.

As she spoke Mandarin and had lived in the country for a couple of years, Klayman knew her way around better than most Western journalists. Day to day, that kept her on the right side of the line with the authorities. But when she followed Ai on his trips to police stations and courthouses there was no way of knowing what would happen. "Every morning I'd wake up on those trips and think, 'OK, what's going to happen today, is it going to go well or is something going to go down?'"

Ai, perhaps best known in the UK for flooding a floor of the Tate Modern in London with porcelain sunflower seeds, is a filmmaker himself and, as the documentary shows, a man who doesn't stand for second best. Klayman had been told before she met him that he could be intimidating to interviewers if they didn't come prepared. "I think I had a pretty healthy respect for what I was dealing with."

She describes him as "incredibly charismatic, impulsive, likes to have a good time, he doesn't take himself too seriously all the time". When she first started the film a big question for her was what was more important to him: the art, the activism or the attention. In the end, she realised that one fed the other. He has had his ideals for a long time, but it is only in the last few years that he has really acted upon them. And being a well-known name helps him do that.

"The more his profile has risen, the more he sees it as his responsibility to use that platform." That high profile comes with a cost, as shown by his arrest. His three months' detention, during which no-one could make contact with him, was "traumatising, a really scary, dark time". As it turned out, the arrest simplified the story, showing what Ai, and Klayman's film, were about.

"It's a movie about what someone can do, not about what someone can't do. It's a movie about how he finds the ways, how he pushes, how individual courage to express yourself is possible in the face of everything and that in China there is room for that kind of thing; it's happening all the time."

Klayman was taken aback by Ai's answer to the question of what the big watershed moment in his life had been. "I was expecting him to say 'my time with my father, Tiananmen, my time in New York.' He said using the internet." He discovered the web in 2005 and realised this was another way of communicating, as through photographs, films and installations, but on a much bigger, faster scale.

Having won the special jury prize at Sundance, Klayman is pondering several subjects for her next film. "My experience with this [film] is that you can't manufacture a good opportunity or a good story, that maybe the best way to do it is the way this happened."

Glasgow Film Theatre, August 10-16; DCA, Dundee, August 17-23; Filmhouse, Edinburgh, August 28-30.