Preheat the oven to 350°F (175°C). Grease a 9×13-inch baking pan and line the bottom with parchment for easy lifting. Set aside.
Make the swirl: In a small bowl, stir the melted butter, dark brown sugar, cinnamon, salt, and vanilla until smooth and syrupy. If using nuts, fold them in. It’ll look glossy and a bit thick—perfect.
Whisk the dry ingredients: In a large bowl, whisk the flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
Whisk the wet ingredients: In a medium bowl, whisk the sweet potato purée, granulated sugar, light brown sugar, eggs, oil, milk, sour cream (or yogurt), and vanilla until mostly smooth. A few tiny sweet potato flecks are fine.
Combine: Pour the wet mixture into the dry. Use a spatula to fold until just combined. Don’t overmix—when the flour streaks start to disappear, you’re there. The batter will be thick but spreadable.
Assemble the cake: Spread the batter evenly in the prepared pan. Spoon the cinnamon swirl over the top in 8–10 generous dollops. Using a butter knife or skewer, drag through the dollops to create ribbons. Think lazy figure-eights—not too much swirling or it’ll blend in.
Bake: Slide the pan onto the center rack and bake for 32–38 minutes, until the top springs back lightly and a toothpick comes out with a few moist crumbs (no wet batter). The edges will be set and lightly golden.
Cool a bit: Let the cake cool in the pan on a rack for 15–20 minutes. You want it warm for the glaze but not so hot that it melts into a puddle.
Glaze: Beat the cream cheese until smooth. Add powdered sugar, vanilla, salt, and 2 tablespoons milk. Beat until pourable but not runny, adding the extra milk if needed. Drizzle or zigzag over the warm cake. Take a second to admire those swirls.
Serve: Slice into squares and serve warm or at room temp. Coffee on the side is never a bad idea.