About Custom widget Setup

Hello

I am currently a beginner who has just started learning about Palantir-Foundry.

I have a few questions regarding the creation of custom widgets.
From what I understand, the main steps are as follows:

  1. Prepare the OSDK

  2. Write the code in the code repository

  3. Create the custom widget(application)

  4. Use the custom widget in workshop

Before starting this process, is the only required preparation to enable the Ontology API and set the SDK for the widget?

Additionally, I would like to know if it is possible to implement a simple code directly within the widget.

Thank you.