SANTA MONICA, Calif. — God has been good to David Javerbaum.

God’s Twitter account (well, @TheTweetOfGod, an account created by Javerbaum that posts witticisms in the name of God) has nearly 2 million followers.

And God’s memoir (actually a book written by Javerbaum) has now been adapted (by God, according to the publicity material — you get the picture) into a new Broadway comedy, “An Act of God,” that begins performances this week.

Jim Parsons has the title role. Why? “For lo, I have endowed him with a winning, likable personality; and know of a certainty that your apprehension of My depthless profundities will be aided by his offbeat charm,” God explains at the start of the show.

Javerbaum thinks it’s quite funny that his play is being staged at Studio 54, a venue not known for its godliness.

But he was not particularly amused by the suggestion that he be interviewed at a house of worship, and, just to drive the point home, You-Know-Who posted a Twitter message that morning: “I’m skipping church.”

So how did a successful, 43-year-old comedy writer — he has won 13 Emmys, 11 at “The Daily Show With Jon Stewart” — arrive at the Supreme Being as a subject?

“Well, I’ve been aware of God for some time,” Javerbaum said dryly, sitting down to meet at — compromise — Holy Grounds, a coffee shop located at a Catholic parish here.

God, Javerbaum noted, has some unique attributes, not just as a deity, but as a vehicle for comedic observations about world affairs and human behavior. The play, like the Twitter account and the book (initially titled “The Last Testament: A Memoir by God”) is presented as a combination of God’s commentary on the world and God’s explanation of the back story to some of his most famous works and deeds.

“God will be discussing a lot of topics, and answering a lot of the questions people have, with the help of his two angels,” Javerbaum said.

“Because it’s from God’s point of view, he could comment on anything that ever happened, ever, and it would not be irrelevant; it would not be off topic,” he added. “With God, I’ve stumbled upon one that organically could have something to say about anything.”

The play is an outgrowth of the tweeting — “I’m happy to be the first person to convert a Twitter account into a Broadway play,” Javerbaum said — but unfolds with greater structure. Javerbaum said that his background in television has made the development process easier.

“I have no problem whatsoever with cutting jokes of mine,” he said. “Being at ‘The Daily Show’ for 11 years, having my jokes killed by the thousands, and killing other people’s jokes by the thousands, after a while you realize, it’s fine; there’s another one out there.”

Currently a producer of “The Late Late Show With James Corden,” he wrote for The Harvard Lampoon as an undergraduate and then for The Onion, “Late Show With David Letterman,” and the Jon Stewart broadcast, where he wound up as head writer and executive producer.

He also loves theater. After Harvard, where he wrote Hasty Pudding musicals, he got a degree from New York University’s graduate program in musical theater composition. His off-Broadway musical, “Suburb,” was well-received in 2001; his Broadway debut, “Cry-Baby,” earned him a Tony nomination for best original score in 2008; he wrote much-celebrated musical numbers for Neil Patrick Harris on the Tony Awards and for the “A Colbert Christmas” special, and he has been developing a rock musical, “Watt?!?,” about James G. Watt, a scandal-tarnished member of President Reagan’s cabinet.

“He’s an incredibly prolific guy,” Stewart said in a phone interview. He described Javerbaum, known to his friends as D.J., as a deft and rapid lyricist, who was able to generate musical numbers on deadline for “The Daily Show.”

God may be a staple for comedians, Stewart said — “you got your sex, you got your religion, you got your death” — but Javerbaum, in particular, “has a natural affinity for the large questions.”

“What’s funnier than an all-knowing, ever-present, all-powerful being sitting down for a lovely conversation?” Stewart pointed out. “And he has the craft to make something intelligent and funny without being nihilistic or meaning to upset.”

Parsons, a multiple Emmy Award winner for “The Big Bang Theory,” previously appeared on Broadway in a revival of “Harvey” and said he had been looking to originate a role in a new play when his agent sent him the script for “An Act of God.”

Raised a Lutheran and now “spiritual” but not churchgoing, Parsons said the challenge of playing God is made easier by the play’s opening conceit — that God has chosen him as a vehicle for communicating.

“I was so tickled by his putting an average human voice and sentence structure together to try to explain some of the most profound, hard-to-imagine concepts in the world, like creating a universe,” he said in a telephone interview.

“I thought it was very, very funny; at its heart it’s a comedy, but, as with a lot of the best comedy, there’s something poignant about it,” he added. “He explores it with a somewhat serious hand; he doesn’t treat the subject lightly, and he doesn’t treat it recklessly.”

Javerbaum grew up attending a Conservative synagogue in New Jersey (“I had a wonderful rabbi, actually — Rabbi Jehiel Orenstein — I’d love to give a shout out to him”), but now describes himself as “not a religious person.” He praised “The Book of Mormon” as an example of a show that satirizes religion. but is “not meanspirited.” But he also acknowledged that the audience for his show is not likely to be religiously orthodox. On Broadway, he said, “You’re preaching to the unconverted — the previously-but-no-longer-converted, as it were.”

Joe Mantello is directing the play, which is scheduled for a 13-week limited run; he and Parsons earlier co-starred in “The Normal Heart” on Broadway. Christopher Fitzgerald (“Finian’s Rainbow”) and Tim Kazurinsky (“Saturday Night Live”) portray the angels.

Javerbaum, who still remembers seeing “Annie” as a small child, said he finds a special thrill in writing for the stage.

“I’ve had my jokes seen by millions of people, like all TV writers do,” he said. “But it’s just not the same thing. Even though a given theater crowd is much smaller — like 1,000 to 2,000 people — that visceral feeling of being in the audience and feeling the laughter, not as a series of electrons abstractly being transmitted to a horde of unseen people, but as actual sounds being taken in and responded to by real live human beings you’re looking at, is amazing.”

In other words: Heavenly.