So you're a week into the keto diet and a co-worker offers you a cupcake. First, resist the urge to slap her and/or cry—she's only trying to be nice. Next, take a deep breath. While you should probably pass on that specific cupcake, you don't have to say goodbye to cakes and other goodies altogether.

But how's that possible? While indulging in desserts can seem like an absolute impossibility on the ketogenic diet—especially considering the fact that most fruits are shunned on this strict high-fat, moderate-protein, ultra-low-carb eating plan—keto desserts do exist, and this delicious lemon sour cream cake is proof (scroll to the bottom for the full recipe). It's all about making strategic swaps and adding in the appropriate keto-friendly foods.

In addition to being keto-friendly, this cake is also gluten-free and low in sugar (keto desserts, which have to be as low in carbohydrates as possible, frequently are), making it a potentially viable dessert option for anyone trying to maintain stable blood sugar. "The idea behind keto is to keep your fat-accumulating hormone, insulin, low by keeping your blood sugar low," explains Vincent M. Pedre, M.D. "In doing so, you turn on fat-burning genes."

Keep reading for more on why this moist, spongy, perfectly lemony keto cake is a smart way to curb sweet cravings.

The ingredients: What makes this cake recipe keto-friendly?

So, how does this keto cake meet the stringent requirements of the keto diet? The answer lies in some key ingredient swaps.

The biggest factor that makes traditional cake recipes a major no-no on the keto diet is the high carb content, which would prevent you from entering ketosis. Normal cake batter is made with traditional wheat-based flour, which is chock-full of carbohydrates. One cup of all-purpose flour, for example, contains an average of 95 grams of carbohydrates. This keto cake, on the other hand, uses almond and coconut flour.

Almond flour is high in monounsaturated fats, which help promote overall health and reduce the risk of heart disease, along with antioxidant vitamin E, and the essential minerals magnesium and potassium. But something to keep in mind: While almond flour is closely related to almond meal, they aren't exactly the same thing. The difference is that almond meal can be made with whole almonds, while almond flour is only made from ground blanched almonds. Almond flour will have a finer texture, and substituting almond meal for flour in the recipe could affect the texture and consistency of the finished cake.

Coconut flour is pretty great too, from a nutritional standpoint as well as its ability to give cake a lighter texture. Coconut flour contains lauric acid, a healthy saturated fat that plays a pivotal role in maintaining a healthy immune system. It's also a great source of both protein and fiber, the latter of which contributes to healthy digestion and good gut health. In fact, a lack of fiber is a major reason many people notice a weight loss plateau on the keto diet, according to Dr. Pedre.

A healthy serving of sour cream adds a nice dose of fat and ensures that this cake is perfectly moist—plus, its creamy-tart flavor is a perfect complement to the lemon zest in this recipe. Eggs are another key component, as they provide this dessert with its spongy texture—without them, you'd be left with an ultra-dense mess. As an added bonus, eggs are a rich source of protein and healthy fats and a good way to get more choline, biotin, selenium, vitamin A, and vitamin B12 in your diet, all of which, experts say, aids in overall health and balanced hormones.

Finally, for a kick of sweetness, this recipe swaps out granulated sugar for erythritol, a natural sugar alcohol that contains just 3 calories per gram and serves as a sugar alternative. "Along with stevia, these sugar alcohols are still decent options for people looking for natural sugar-free options," William Cole, D.C., IFMCP, functional medicine expert, told mbg. Sugar alcohols are considered safer than artificial sweeteners like sucralose (Splenda), aspartame (Equal and NutraSweet), and saccharin (Sweet N' Low), all of which may "actually change the bacterial makeup of your microbiome," said Dr. Cole. "This can be a trigger for autoimmune problems, diabetes, and metabolic disorders."

It's important to note, however, that sugar alcohols aren't a great option for everyone. They are known to have a laxative effect if consumed in high quantities and can cause major flare-ups of digestive problems like irritable bowel syndrome (IBS) and SIBO. Since your body does not completely absorb sugar alcohols, they're left to ferment in the large intestine, which can cause gas and bloating. The short version: If you suffer from one of these digestive conditions, you may want to avoid this (and most) keto dessert recipes.

How to incorporate this cake into your keto diet.

Even though we've just raved about what makes this cake recipe keto-friendly, it should still be considered a treat for special occasions, not for daily consumption. Keto cake shouldn't take the place of healthier fare like low-carb, fiber-rich vegetables, nuts and seeds, and quality meats, eggs, and seafood. "If you're using ketosis for weight loss, you may see initial results, but eating too many calories from any food can stall fat loss or make you gain weight," explains Dr. Pedre.

Leaning too heavily on keto-approved treats can definitely have this effect and undermine your success (as they tend to be calorie dense and low in fiber), but using them strategically—to help you avoid an all-out sugar binge—might just help keep you on track.

And remember, deciding whether or not the keto diet is right for you is a personal decision and one that you should discuss with your health care provider. The diet brings with it a lot of potential benefits, including the ability to reduce insulin levels, reduce inflammation, and aid in weight loss, but it also has potential drawbacks. If you do decide that trying the keto diet is right for you (or if you're just looking for a healthier alternative to regular, high-carb cake), you'll want to bookmark this lemon sour cream cake recipe from keto blogger Mellissa Sevigny's cookbook Keto for Life.

Preheat the oven to 350°F. Grease a 12-cup Bundt pan with butter or coconut oil.

Place the cake ingredients in a commercial-grade blender or a food processor and blend until smooth. The mixture will be thick, so you'll have to scrape down the sides with a rubber spatula a few times to get it to blend until smooth.

Spoon the batter into the greased Bundt pan and spread it evenly. Bake for 55 minutes, or until a toothpick inserted in the center of the cake comes out clean.

Remove from the oven and let cool on a rack for at least 30 minutes before unmolding onto a cake plate or pedestal.

Meanwhile, place the glaze ingredients in a small bowl and stir until well-blended and pourable. If it's too thin, add more sweetener; if it's too thick, add more lemon juice. It should be just thin enough to pour in an even stream with no clumps.

Unmold the cake and pour the glaze evenly over the top. Cut into 12 even slices when ready to serve. Store on a covered cake plate or pedestal in the refrigerator for up to 1 week or in the freezer for up to 3 months.