When the ground began to shake, rocking her bed to-and-fro, Temilade Openiyi briefly wondered if she was dreaming. It was a bright April morning, and she was still jet lagged from a flight — 12 hours from Lagos, Nigeria, to New York. It seemed unlikely that her hotel could actually be vibrating.

Openiyi, better known as Tems, had stopped on the East Coast on her way to Los Angeles, where she began rehearsals for her debut appearance at the Coachella music festival. It was one in a multiplying series of firsts this year. The singer, songwriter and producer — whose music slides between R&B, pop and Afrobeats — then dropped her first album — “Born in the Wild” with its first single, the blissful party starter “Love Me JeJe” — and kicked off her first headlining world tour in June. As far as milestones are concerned, a first earthquake was just another line in the tally.

Tems, a faithful Christian, believes none of it has been in her control. When the earthquake subsided (magnitude 4.8), she said a prayer thanking God for granting her another day.

“You can be planning your whole life, and then something happens, and it’s just done,” she said dryly, in a recent interview. “You can control what you do, but you can’t control how life lifes.”

It would be easy to attribute Tems’ vertiginous career trajectory to divine intervention. Since her appearance on Afrobeats star Wizkid’s summer-conquering single “Essence” in 2020, Tems has become the first African artist to debut at No. 1 on the Billboard Hot 100 (via “Wait for U,” a Future song also featuring Drake); won a Grammy for best melodic rap performance; and been nominated for an Oscar, for “Lift Me Up,” a song from the “Black Panther: Wakanda Forever” soundtrack that she co-wrote for Rihanna. In 2022, Tems was a writer and performer on “Move” — also featuring Grace Jones — from Beyoncé’s “Renaissance,” confirming her status as one of the most in-demand and closely watched young artists in the world.

Tems’ journey to the verge of stardom built slowly before erupting all at once. Born and raised mostly in Lagos, she grew up enchanted by the R&B powerhouses of the 1990s, including Destiny’s Child, Mariah Carey and Celine Dion. She didn’t speak until she was 3 years old, and was an often solitary child who attracted the attention of bullies. Music, which first captured her imagination via pirated CDs from her brother’s friends, became an early means of escape. She joined the choir in school, wrote her own songs and “forced” her friends to sing them, she said. But she never had a specific vision of a career as an artist.

“I used to say I wanted to be an architect, but I only said that because it seems smart,” she said. “When you say ‘architect’ as a child, everyone is like, ‘Hmmm. You have your head around your shoulders.’ ”

It wasn’t until college that she got serious about music. Between economics classes at Monash University College in Johannesburg, Tems taught herself to produce her own songs by watching videos on YouTube. After graduating, she worked briefly in digital marketing before taking the leap to pursue music full time.

“I just thought, ‘This is what I’m actually gifted at,’ ” she said. “I should do something that comes naturally to me rather than trying to force it.”

Among the earliest songs that she produced was “Try Me” in 2019, a soaring testament to resilience in the face of opposition that contains many Tems hallmarks: lyrics about burning, a protagonist engaged in a righteous struggle and a go-for-broke vocal performance that bends from yearning to fury and back.

“It became an anthem in Nigeria very quickly,” said Wale Davies, Tems’ co-manager, who began working with her shortly before “Try Me.” “After that song, we would do a show, and people would be chasing after her car.”

The video for “Try Me,” in which Tems mugs fiercely at the camera while surrounded by regal escorts, was a fixture on Nigerian music television and has more than 18 million views on YouTube. After hearing the song, Wizkid invited her, through a manager, to a recording session for his album “Made in Lagos.” Tems chose the “Essence” instrumental and started freestyling over it, singing about a love affair that defies understanding: “I need to give it all/ I tried to leave but I can’t/ I don’t know why you’re the one/ turn me out of my mind.”

“There are certain beats that make you feel something, and I’m always looking for that feeling,” she said. “When I heard the ‘Essence’ beat, I was immediately like, ‘Yeah, this is the one.’ ”

Tems writes most of her songs this way: A beat or piece of music inspires a feeling, which she channels into a melody and a few words of gibberish. Lyrics come last. Her phone’s voice memos app is filled with thousands of such freestyles and fragments, a small fraction of which will eventually become finished songs.

The way Tems describes it, she is almost a passive participant in this process — a mere radio in search of a preexisting frequency. “I just have a sensation, I have signals,” she said. “You’re just the vessel, it’s just coming out of your mouth.”

If Tems is a humble vessel at the start of her creative process, she transforms into an obsessive sculptor at the end. She is known to lock herself alone in her studio for days at a time, adding elements to a draft of a song and excising others until it aligns perfectly with what she hears in her head. Her music is an effort to reconcile the opposing themes of her life: willfulness and submission, control and freedom, tension and release.

Guiltybeatz, a producer of “Love Me JeJe” and a frequent Tems collaborator, said her goal with a song is to achieve a kind of platonic state in which she can listen to it endlessly without losing enthusiasm.

“We want to live with this music forever,” he said. “Until we get to that point where we feel like we’ll never get tired of it, we keep working.”

Tems cited two other singers known for their foresight and creative discipline as inspirations for her own debut: Lauryn Hill and Sade. Both artists, she said, managed to achieve critical and commercial dominance without compromising their integrity.

Success, for her, would mean maintaining a similarly solid foundation, the kind that can withstand a few unexpected shakes.

“You can have the biggest hits, and people still may not receive you in the way that you want them to,” she said. “It’s not about what you do, it’s who you are.”