Is there a shared prototype API? Goal is to augment a prototype

Hello,

I’d like to understand if there is a API or any way to access state information from an anonymously (password protected) shared prototype.

For example, lets say I’m trying to prototype an IOT environment where a light turns on when the user successfully navigates to a specific prototype frame.

I can imagine two ways to do this:

  1. Wrapping the prototype in an iframe and being notified through the window variable on the current frame_id. (I know it would require storing a mapping of frame_ids, which is fine).
  2. Inserting some custom javascript code into the prototype frame that can trigger when the frame is hit.

Does anyone know if this is possible or if there are any plans for this? Offering even basic extendability of the prototype can really increase the usefulness of Figma Prototypes.

Thanks!

It looks like we may be able to pull that from the node-id variable in the url, as long as that’s stable it could work. Would be nicer if there’s a supported method.

How are you able to execute this without violating cross-domain security protections? Trying to pull node-id changes seems impossible for me to execute because the prototype is contained in an iframe whose properties can’t be read from a different domain (in my case, a localhost).

I’m trying to accomplish the same goal that OP was, so if anyone else has any other ideas or solutions, I’m all ears.