Skip to content

Embed the Suborbital code editor into your React application.

License

Notifications You must be signed in to change notification settings

suborbital/editor-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 {
  /** The public URL of your builder service */
  builder: string;
  /** The identifier used to address your specific user */
  ident: string;
  /** The optional function namespace */
  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?: {
    /** Hide the name of the function in the editor */
    hideName?: boolean;
    /** The public URL of the code editor; defaults to editor.suborbital.network */
    editorUrl?: string;
    /** The width of the code editor */
    width?: number | string;
    /** The height of the code editor */
    height?: number | string;
  };
}

Developing

After an initial npm install, build the project with npm run rollup. That's it!

About

Embed the Suborbital code editor into your React application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published