Back to Blog
Apr 14, 2024

Embeddable functions with ClearScript in .NET CMS

Written by Zack Schwartz


With our new release of v1.2.0, Raytha introduces Embeddable Functions.

Raytha Functions are a way to write custom code in the administrator portal of Raytha to add functionality to your application. Use cases for this include but are not limited to:

  • Create your own custom api endpoints
  • Accept form submissions and save response
  • Send an email out of the platform
  • Make an external HTTP call and return and/or save result
  • [Coming Soon] Webhooks trigger functionality
  • [Coming Soon] Timer trigger functionality

In a way, it is effectively writing "code behind" directly into the platform.

Writing code behind

When you write code for a Raytha Function there are few items you need to be aware of.

  • Write your code in javascript. The code is compiled and run using Microsoft's ClearScript engine which works with V8 implementation of javascript. This gives you access to basic engine javascript.
  • Triggers. Functions are triggered by some action. You select the trigger type when you create the function.
  • Built-in objects. The javascript by itself would not be of much use if you did not have layer of access to the database and other core functionality.

Triggers come with boilerplate code that the ClearScript engine runs when necessary. Click the link below to learn how to write code for each trigger type.


Learn more about embedding code inside Raytha.



picture of the author
Zack Schwartz @apexdodge

ENTREPRENEUR & SOFTWARE ENGINEER, AUSTIN, TX
I enjoy tackling a wide array of business challenges ranging from front line product support and operations to sales and marketing efforts. My core expertise is in software development building enterprise level web applications.


Subscribe to the Raytha newsletter