Prep the potatoes: Peel the sweet potatoes and grate them on the large holes of a box grater or using a food processor with a shredding disc. Aim for even shreds so they cook uniformly.
Remove moisture: Place the grated sweet potato in a large bowl.
Sprinkle with a pinch of salt, toss, and let sit for 5 minutes to draw out water. Transfer to a clean kitchen towel and squeeze out as much liquid as possible. This step is critical for crispness.
Add onion and seasonings: If using onion, grate it and squeeze out excess liquid as well.
Return the sweet potatoes to a dry bowl, add the onion, cornstarch, egg (if using), salt, pepper, paprika, garlic powder, and cayenne. Toss until well coated. The mixture should feel damp but not wet and hold together when pressed.
Preheat the pan: Heat a large cast-iron or nonstick skillet over medium to medium-high heat.
Add 1–2 tablespoons of oil and swirl to coat. The oil should shimmer before you add the mixture.
Form the hash browns: For individual patties, scoop about 1/3 cup of the mixture and press it into a thin patty about 1/4 inch thick. For a skillet-sized hash brown, spread an even layer across the pan and press down with a spatula.
Cook without fussing: Place the patties or the large hash brown in the hot pan.
Cook for 3–5 minutes before moving them. You want a deep golden crust to form. If the pan looks dry, add a bit more oil around the edges.
Flip carefully: Slide a thin spatula under the hash browns and flip.
Cook another 3–5 minutes, lowering the heat slightly if they’re browning too fast. The centers should be tender, and the edges crisp.
Finish and season: Transfer to a paper towel–lined plate to absorb excess oil. Sprinkle with a little extra salt while hot.
Repeat with remaining mixture, adding oil as needed.
Serve: Top with chopped herbs and serve with eggs, avocado, hot sauce, or a dollop of Greek yogurt. For a heartier plate, add sautéed greens or a side of bacon or tempeh.