While they were simply a costume accessory for many years, the Star Wars Rebels cartoon first identified them as “Code Cylinders” - essentially keyfobs to get into secure locations. They feature in Mando Season 2 (Chapter 12: The Siege), which I believe is the first time we’ve seen them used in live action.