Hi there,
I’m creating my first pack (yay ), I’m not a developer but managed to get it to do what I wanted…
However if I want this pack to potentially also be useful for others, I’d need to figure out 2 things.
But first, what does the pack do?
This pack allows to add a button that triggers a webhook in Thrive Automator (a WordPress automation plugin).
The Thrive Automator plugin provides the webhook URL to use in the POST request BUT this also means that the webhook is specific to the WordPress domain and that’s where my first issue comes in:
- Because this Pack uses “fetcher.fetch”, specify the domain that your Pack makes HTTP requests to using "pack.addNetworkDomain(‘example.com’)
==> I can do this manually for my own pack and code, but I would like for this to be dynamic and based on the domain that the user fills out (as this would be their own self hosted WP website).
I tried using a parameter but that’s not the way to go.
I read in the documentation:
There are services however where each account is associated with a distinct domain, instead of a sub-domain of a common root domain. This makes it impossible to declare them ahead of time as network domains. In these cases you can omit network domain declaration from your Pack, which will allow it to make requests to the account’s endpoint URL (and only that URL) regardless of domain.
And I feel the answer is in there BUT I can’t seem to figure it out (as there is no other authentification or token or anything needed)
So ideally, I would somehow give the user the option to enter the enpoint URL themselves and use that for the addNetworkDomain.
Is this possible? Any pointers as to how?
- I would like for parameters to be optional for the user. Is that possible? Now it seems like all parameters are required for it to work.
Thanks!