Get the actual user in custom widget

Is there a way to get the actual user in a custom widget . I’m using the custom URL and custom widget builder and I need to know which user is using the widget or logged in.

@Alfredo_Ardito have you made any progress? I’m also trying to do the same thing.

I found a workaround solution because I don’t think its possible through the Grist plugin api to get the user directly.

To get the user name and user email from a custom widget:

  1. Add a trigger formula to a column user.Name or user.Email (apply to new records)
  2. use the plugin api to create a new record in that table onload
  3. then read the row to get the values

Hi, i’m looking to do there same, but after trying many hours i can’t find a working workaround.
I tried many things in the “Custom widget builder”, but its in iframe and it seems like the API cant pass it
Can you please explain how it’s done with code example.
Thanks!

the plugin does that on initialization?

It”s a smart technique.