adobe / reactor-scaffold

Command line scaffolding tool to build extensions for Adobe Experience Platform Tags.
Apache License 2.0
11 stars 9 forks source link

Edge extension using main and update context #30

Open alcazes opened 2 months ago

alcazes commented 2 months ago

In Web extension we are able to specify the main property to run code as the extension initialise

i.e in extension.json we would specify

{
  "main": "src/lib/main/extensionMain.js"
}

Is there the same functionality when creating edge extension ?

If so are we able to update context to contain additional data as part of this step?

The requirement is before any rules are triggered we need to make a call to third party to fetch feature flags and custom config and from there we want to condition rules based on data returned

dompuiu commented 1 month ago

There is no main property in edge extensions.

There is no cache concept in Event Forwarding. So the call for fetching custom config will happen for every call that gets to Event Forwarding. Can you describe with more detail the workflow you are envisioning?

alcazes commented 3 weeks ago

We are planning to make our tagging configuration agnostic which means that we will split the configuration and the code source of the third party marketing pixels for example.

Event forwarding rules will contain the logic to send the data to the marketing providers but we will not maintain the configuration that is needed for the marketing pixels to be send.

We will use another tool to save the configuration in a JSON format. My plan is for event forwarding to load this JSON config before any rules are executed, this way we do not have to fetch the JSON config per rules.

Would it be possible to add a functionality in the Core extension to add custom code that would allow to add a JSON payload that will be inherited by all rules ?