Get components by name

You can now retrieve a component by its name and optionally its group with the new webflow.getComponentByName() function (Beta):

1// Fetch a component by name only
2const heroSection = await webflow.getComponentByName('Hero');
3console.log(heroSection.id);
4
5// Fetch a component scoped to a group
6const marketingHero = await webflow.getComponentByName('Marketing', 'Hero');
7console.log(marketingHero.id);

For more information, see Get component by name (Beta).