Pat the chicken dry and season lightly with salt and pepper. Heat the oil in a large skillet or Dutch oven over medium-high heat. Brown the chicken for 3–4 minutes per side until golden in spots. Transfer to a plate.
In the same pan, lower the heat to medium and add the onion. Cook for 3–4 minutes until softened. Add the garlic, ginger, and dried chilies (if using) and cook 1 minute more.
Pour in the kecap manis, soy sauce, and water, stirring to lift the browned bits from the pan. Return the chicken and any juices to the pan.
Simmer gently, uncovered, for 15–18 minutes, turning the chicken once, until it is cooked through (165°F / 74°C) and the sauce has reduced to a glossy glaze. Add a splash of water if it thickens too fast.
Stir in the tomato wedges (if using) and green onions for the last 2 minutes, just until the tomato softens slightly.
Taste — it should be sweet and savory; adjust salt or kecap manis as needed. Rest 5 minutes, then serve over steamed rice with lime and fried shallots if you like.