There are a few different strategies to making sure that your private plugin is ready for publishing, in terms of protecting personal information. While no form field data is visible to anyone installing a published recipe, the number one risk is with the screen generated to show what the plugin does.
Best Practice: When publishing a plugin, it will have a new badge, "Recipe Master". This should stay in a "demo" state, and you should Install the recipe again in your account, just as other users would do, for personal use.
Webhook Strategy Recipe
This is the easiest option, since the data is pushed to our servers via a webhook. Using cURL, a tool like Postman or Insomnia, or other method, you can manually push demo/fake data to your plugin recipe, then force refresh your plugin to render the screen using the data you pushed.
Polling Strategy Recipe
There are a few options when pulling data from a 3rd party source, in various levels of difficulty.
Tip: You can freeze your plugin's screen by removing it from any playlists. A plugin (in full view) not in a playlist will not have its (full view) screen refreshed, which is the view used for the install page of a recipe.
Creating a Demo Account
If the service offers a free account option, create an account and populate it with demo data. If that data would automatically deteriorate due to it being time based (e.g., last 90 days), then use the freeze tip above.
Different URL
Some plugins are pointed to a self-hosted service or custom URL, which is data collected in the form fields. Create a sample response, for instance JSON, with fake data, then host that file on a personal server or as part of a GitHub project, providing a reliable source to feed the demo data.
API Key or Other Unique Form Field Value
If a demo account isn't an option, and the plugin uses a form field for an API Key, you can use a trick in the markup to provide fake data when the API key matches a specific value.
For instance, imagine you have a form field with the keyname of apikey. You set the value to 0 in your plugin's settings. Then, edit the markup. Assuming that Your Variables returned a variable data, representing the response from the polling URL, you could add code at the top of your Shared view like:
{% if trmnl.plugin_settings.custom_fields_values.apikey == "0" %}
{% assign data = '[{"id":"01ABC123XYZ456"},{"id": "01FIELD123"},{"id": "01ROLE123"}]' | parse_json %}
{% endif %}In this example, we're providing replacement JSON data for the data variable, before the rest of your script would process that variable, but only if the API Key is "0". Using this trick, you can set your recipe master's API Key to 0 and always be displaying this fake data to showcase your plugin.
