Platform CLI Use cases
Learn
Developer docs User guide Quickstart CLI and AI agents Blog
Company
Services About Contact Links Get started

Embeddable functions with ClearScript in .NET CMS

Watch on YouTube Subscribe to Raytha
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.


Share Post LinkedIn

Try Raytha on your own site

Free, open source and ready to deploy in minutes.