Suborbital Code Editor
This project allows you to embed the Suborbital code editor into your React application.
Setup
Install the library:
npm install @suborbital/editor-react
Import the library:
import { Editor } from "@suborbital/editor-react";
Render the editor:
<Editor
builder="https://mybuilder.com"
ident="com.acmeco.123"
functionName="myfunction"
token="4gSBo8miBWjwXg2rBGHk1tYa"
template="javascript"
/>
You can find the full set of configuration options listed below:
interface EditorProps {
builder: string;
ident: string;
namespace?: string;
/** The name of the function */
functionName: string;
/** The editor token retrieved from the controlplane service */
token: string;
/** The function template to render */
template: string;
/** Additional configuration options */
options?: {
hideName?: boolean;
editorUrl?: string;
width?: number | string;
height?: number | string;
};
}
Developing
After an initial npm install, build the project with npm run rollup. That's it!