How to Make It
In a medium bowl, using a rubber spatula, mix the butter with the cilantro, shallot, garlic, lime zest, lime juice, 1 teaspoon of kosher salt, 1/2 teaspoon of pepper and the cayenne.
Season the chicken generously with salt and pepper. Carefully loosen the breast and thigh skin of the chicken. Spread about 4 tablespoons of the seasoned butter under the skin. Rub the remaining butter all over the outside of the chicken. Let stand at room temperature for 15 minutes.
Preheat the oven to 400°. In a large cast-iron skillet, toss the red onions with the olive oil and generous pinches of each salt and pepper. Open the can of lager and set in the center of the skillet. Stand the chicken upright on the can and roast in the center of the oven, basting the bird occasionally with the pan juices, for about 1 hour, until a thermometer inserted in the inner thigh registers 160°. Remove the skillet from the oven and tent the chicken with foil. Let rest for 15 minutes.
Carefully transfer the chicken to a carving board and discard the beer can. Using a slotted spoon, transfer the onions to a small serving bowl. Carve the chicken and transfer to a platter. Sprinkle the chicken with flaky salt and serve with lime wedges and the roasted onions.