Get current plugin Id from Lua

Hi, is it possible to get the subj using PDK?

Thanks in advance

Hi @Alexander_Altshuler,

I’m curious as to why you would like to access the ID of the plugin being executed. Could you elaborate your problem a little?


Sorry for later reply.

I see 2 possible use cases:

  • store per-plugin-instance data on module level
  • self-update configuration of the plugin

For both cases IMO I need to know plugins Id in Lua.


I don’t think this is possible as of today. You could open a feature request if you would like this feature.

You can do this today, but the functionality is not exposed by PDK (although we have plans to do so eventually).

You have to be careful and know what you are doing, or else you are exposing yourself to potential memory leaks (i.e. “non reclaimable references”). Several bundled plugins follow such a pattern, for example:

Which builds and caches per-plugin-configuration (what you refer to as “per-plugin-instance”) state only once, for efficiency purposes: