Need API/Webhook support for branches and ability to lock/protect branches

Hi there,

For the Design System we’re building which drives off Figma to create React components, we have a couple of requests regarding branching from the Dev side of our blended team.

  1. We really need Webhook support for branches. For us to be able to connect to the Dev side of our Figma workflow, we need a webhook, event or payload information related to branching. We’re not sure what this would look like on Figma’s end, but we would need events to hook into so we know when to run our custom parser against it, since the system we’re building results in React Web components. We’d want to do this at a branch level, but currently there doesn’t appear to be a way to differentiate between a “real” event and a branched event.
  2. The ability to lock or protect a branch - aka create a “staging branch” that’s semi-permanent so people can’t accidentally delete or remove it.

Putting this request forward in hopes of escalation to the Figma Product Team since from the Office Hours preso and subsequent Q&A, I recall you guys saying that API/Webhook support is being considered but isn’t yet on the roadmap, and we feel it’s approaching a must for how we’d like to leverage this feature in our DS to create and QA more safely, and in-line with Dev workflow best practices.

2 Likes

Hi there! Thanks for writing in with these ideas.

currently there doesn’t appear to be a way to differentiate between a “real” event and a branched event

It’s a bit of a work-around but after receiving a webhook message, you could query the REST API files endpoint for the file key and include the new “branch_data” parameter. If the response includes the “mainFileKey” property, it’s a branch.

Please let me know if that works for you!

The ability to lock or protect a branch - aka create a “staging branch” that’s semi-permanent so people can’t accidentally delete or remove it.

Can you tell me more about why you want to protect a branch? Branches can only be archived by editors on the branch or the main file. Does your workflow work if you change some of those people to viewers?

Hey John,

This seems pretty reasonable to us, thank you! An extra API call on our end, but we’re not requiring immediate millisecond turnaround on the publishing.

The branch protection, basically we want environments. We want to make essentially a copy of the main file that is merge-able, but doesn’t disappear after the merge. We want a true staging and the current workaround is to do that manually which isn’t automated or optimal from a workflow POV.

We want merging, always, between two branches. Ability to synchronize essentially.

Thanks for explaining your idea about branch protection. We are definitely thinking about these more complex workflows, and will keep your feedback in mind!

2 Likes

I have a potential simpler request w.r.t. branch protection: what we’d like is actually to lock the Main branch to avoid accidental changes, in other words, only allow changes in branches that will later be merged (or discarded).

Separately, it would be great to distinguish the “can branch” vs. “can merge/commit” permissions. For instance, editors should be able to branch, but maybe only owner/admins can merge into Main. This would greatly help with broadly shared and sensitive libraries like design systems.

7 Likes