How do I create an SDK for Ruby on Rails?

Builder public api key
fe63f61359c84e84b5e35d491a903ea2

What are you trying to accomplish
I want to create a new SDK for Ruby on Rails to have seamless integration with our everyday backend framework.

Code stack you are integrating Builder with
Ruby on Rails

Hello!

So… I’ve been trying to get Ruby on Rails working with Builder and I can kind of get it working with Qwik by delivering components from our Rails app with an extra API call… but it’s pretty hacky.

It also means we need to be running a whole other stack that we’re not familiar with - the JS ecosystem.

So, I’d like to at least see how difficult it is to create an SDK for Ruby on Rails via Mitosis.

I’ve got Cursor powered up and I’m motivated to learn.

I’ve looked at the builder SDK but can’t figure out how to create new SDKs.

I accept that there would have to be some degree of JS, but I’d like to use Turbo to load the components and partials.

Is this possible? Has anyone tried this with a backend framework before? Where would you suggest I start?

Thanks!

John Gallagher

Hi John,

Thank you for your interest in adding Builder Rails support.

To use Builder with Rails today, consider our HTML API Builder.io HTML API - Builder.io, or the Qwik API Builder.io Qwik API - Builder.io (an optimized alternative to our HTML API).

Given that you are using a backend framework and want to avoid JS, this might be the best path forward.

As for creating a Rails SDK:

As you implied, our SDKs are generated using Mitosis and maintained in one codebase. Generating a Rails SDK would require the following:

  • Adding Mitosis support: Mitosis does not currently generate Stimulus code, which is a pre-requisite for generating a Rails SDK.

  • Generating the SDK: use the new Mitosis generator to create the Rails SDK, and resolve any issues that come up.

Due to Rails being a backend framework, and Stimulus being very different from the rest of the frameworks supported by Mitosis and our SDK’s codebase, it will be a non-trivial undertaking to generate a satisfactory Rails SDK. There are many features in React/Svelte/Vue/etc. that will likely need workarounds in the Mitosis Stimulus generator.

If you are interested in adding Mitosis support for Stimulus, please join the Mitosis discord (Mitosis) and we will try to help you out!

If you have any other questions, please let me know.

Thanks,
Sami

1 Like