A bakery in California has found itself at the centre of an international storm after it welcomed the president of Taiwan with a cup of coffee and a goody bag.

The result was a major diplomatic incident as Chinese customers launched a boycott of the 85C Bakery Cafe, which rapidly disappeared from online ordering platforms on the Chinese mainland.

The episode highlight's Beijing's sensitivity over an island that considers itself a sovereign state, but has never declared formal independence.

The Taiwanese-owned chain apologised and distanced itself from the views of Tsai Ing-wen, the pro-independence leader of the island, after she dropped in on Wednesday en route to visiting allies in South America.

Excited staff gave her a gift bag and took selfies, as images were uploaded to Facebook by part of her delegation.