Shares of Twilio (NYSE:TWLO) surged nearly 20% on Aug. 7 after the cloud services provider posted impressive second quarter numbers that easily beat analyst expectations. Twilio's revenue jumped 54% year over year to $147.8 million, beating estimates by nearly $17 million and marking the company's third straight quarter of accelerating sales growth. Twilio expects its sales to rise 49%-51% in the current quarter.

The company's non-GAAP net income of $2.9 million represented a significant improvement from its loss of $4.8 million in the prior-year quarter. Non-GAAP earnings per share (EPS) of $0.03 also cleared expectations by eight cents, notching the company's first non-GAAP profit since its IPO in June 2016. Twilio expects to maintain that profitability with non-GAAP earnings of $0.02 to $0.03 per share in the current quarter.

A man access apps on a secure tablet.

Image source: Getty Images.

Those numbers look impressive, but investors are probably wondering if Twilio is still worth chasing after its 220% rally this year. Let's dig deeper into Twilio's second quarter numbers to find out.

First the good news...

Twilio's cloud platform handles text messages, phone calls, videos, and other content for app developers via APIs (application programming interfaces). Developers simply add Twilio's code to their apps to integrate those services.

Demand for Twilio's services is booming, since integrating APIs is more scalable, cheaper, less buggy, and less time-consuming than building those features from scratch. That's why Twilio's number of active customers rose 32% year over year to 57,350 last quarter.

Twilio uses two other key metrics to gauge its growth: its base revenue, which comes from customers who sign 12-month-minimum revenue contribution contracts; and its dollar-based net expansion rate, which measures its sales growth per customer. Both these metrics accelerated over the past two quarters.

 

Q2 2017

Q3 2017

Q4 2017

Q1 2018

Q2 2018

Base revenue growth

55%

43%

40%

46%

54%

Dollar-based net expansion rate

131%

122%

118%

132%

137%

Source: Twilio quarterly reports.

Twilio's accelerating base revenue growth indicates that it's depending less on big non-base "variable" customers like Facebook's WhatsApp. The company expects base revenue to rise 54%-55% in the third quarter.

Twilio's growing dollar-based net expansion rate tells us that the organization is successfully cross-selling other services (like video and security features) to its customers. That should make it easier for new initiatives, like its Twilio Build partner program, its new APIs for WhatsApp, and its Twilio Flex collaboration with Alphabet's Google Cloud, to squeeze out more revenue per customer.

Twilio's full-year guidance also looks solid. It expects its sales to rise 47%-48%, its base revenue to grow about 50%, and its non-GAAP EPS to stay in the black. Those numbers all compare favorably to its 44% sales growth, 49% base revenue growth, and non-GAAP loss in 2017.

Now some bad news...

Unfortunately, Twilio's emphasis on non-GAAP calculations masks some less flattering numbers. On a GAAP basis, Twilio's net loss actually widened from $7.1 million in the prior year quarter to $24 million. On a per-share basis, its loss widened from $0.08 to $0.25.

A businessman ducks under a crashing stock chart.

Image source: Getty Images.

The huge gap between Twilio's non-GAAP and GAAP numbers is caused by the exclusion of stock-based compensation (SBC) expenses from the former. Twilio's SBC expenses spiked 69% annually last quarter and consumed 14% of its revenues, compared to 13% in the prior-year quarter.

The increase is reflected in the company's operating expenses, which surged 68% annually -- outpacing its sales growth -- to $101.8 million. That jump caused Twilio's operating loss to widen from $7.1 million to nearly $22 million.

Meanwhile, Twilio faces a growing number of competitors, including Bandwidth and Vonage's Nexmo. Both companies offer similar services but are profitable on a GAAP basis. Vonage leverages its core telephony business to support Nexmo's growth, while Bandwidth uses its own nationwide IP voice network to generate higher operating margins than Twilio. Holding these rivals at bay could result in wider losses for Twilio.

Lastly, Twilio's stock trades at lofty valuations. It trades at 12 times this year's sales and 10 times next year's sales. Assuming that it can maintain its non-GAAP profitability, the company trades at nearly 580 times next year's non-GAAP earnings.

The verdict: Too rich for my blood

I sold my Twilio shares too early, and I regret missing the stock's rally over the past year. But at these levels, Twilio looks overvalued, and investors aren't paying enough attention to its GAAP numbers. I'd stay away from this stock until it cools off.

 

Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Leo Sun owns shares of Facebook. The Motley Fool owns shares of and recommends Alphabet (A shares), Alphabet (C shares), Facebook, and Twilio. The Motley Fool has a disclosure policy.