I'm creating a custom content block by extending content builder as described here: https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/content-sdk.htm
I'm using the BlockSdk setContent method to populate the block after the user has selected the content from my extension. Part of the content that I'm passing in is server-side javascript to get some recipient data at email send time and make some requests to my server, but when the content is inserted the javascript block is being stripped out. What is the reason for the javascript being stripped out when calling setContent on the blockSDK? Do I need to use AMPscript for this use case?
This is a simplified example of what I'm trying to output:
<script runat="server">
Platform.Load("core", "1");
var firstName = Platform.Recipient.GetAttributeValue("First Name");
Variable.SetValue("@FirstName", firstName);
</script>
Hello %%=v(@FirstName)=%%