2.6.3-5 • Published 6 months ago

@vietdanh1899/lowcoder-sdk v2.6.3-5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

lowcoder-sdk

Usage

yarn:

yarn add lowcoder-sdk

npm:

npm install lowcoder-sdk

Integrate Lowcoder's app/module into existing app page

  1. Publish your app/module in Lowcoder.
  2. Set the app/module's access privilege as public.
  3. Add code in your existing app as below.

Import style

import "lowcoder-sdk/dist/style.css";

For react app:

import { LowcoderAppView } from "lowcoder-sdk";

<LowcoderAppView appId="{YOUR_APPLICATION_ID}" />;

LowcoderViewProps

NameTypeDescriptionDefault value
appIdstringThe app's id in Lowcoder. Required!--
baseUrlstringLowcoder's api base url--
onModuleEventTriggered(eventName: string) => voidTriggered when module's custom event is triggered. Works only when the app is a module.--
onModuleOutputChange(output: any) => voidTriggered when module's outputs change. Works only when the app is a module.--

Invoke module methods

import { useRef } from "ref";
import { LowcoderAppView } from "lowcoder-sdk";

function MyExistingAppPage() {
  const appRef = useRef();
  return (
    <div>
      <LowcoderAppView appId={YOUR_APPLICATION_ID} ref={appRef} />;
      <button onClick={() => appRef.current?.invokeMethod("some-method-name")}>
        Invoke method
      </button>
    </div>
  );
}

For vanilla js:

import { bootstrapAppAt } from "lowcoder-sdk";

const node = document.querySelector("#my-app");

async function bootstrap() {
  const instance = await bootstrapAppAt(YOUR_APPLICATION_ID, node);

  // set module inputs
  instance.setModuleInputs({ input1: "xxx", input2: "xxx" });

  // invoke module methods
  instance.setModuleInputs({ input1: "xxx", input2: "xxx" });

  // listen module event trigger
  instance.on("moduleEventTriggered", (eventName) => {
    console.info("event triggered:", eventName);
  });

  // listen module output change
  instance.on("moduleOutputChange", (data) => {
    console.info("output data:", data);
  });
}
2.6.3-4

6 months ago

2.6.3-5

6 months ago

2.6.3-3

6 months ago

2.6.3-2

6 months ago

2.6.3-1

6 months ago

2.5.3-5

7 months ago

2.5.3-2

7 months ago

2.5.3-3

7 months ago

2.5.3-4

7 months ago

2.5.3-1

8 months ago

2.4.12-7

9 months ago

2.4.12-6

10 months ago

2.4.12-1

10 months ago

2.4.12-5

10 months ago

2.4.12-4

10 months ago

2.4.12-3

10 months ago

2.4.12-2

10 months ago

2.4.10-2

10 months ago

2.4.10-1

10 months ago

2.4.1-1

11 months ago

2.4.5-3

11 months ago

2.4.5-2

11 months ago

2.4.5-1

11 months ago

2.4.27

1 year ago

2.4.25

1 year ago

2.4.24

1 year ago

2.4.26

1 year ago

2.4.23

1 year ago

2.4.22

1 year ago

2.4.19

1 year ago

2.4.21

1 year ago

2.4.20

1 year ago

2.4.18

1 year ago

2.4.17

1 year ago

2.4.16

1 year ago

2.4.15

1 year ago

2.4.14

1 year ago

2.4.13

1 year ago

2.4.5

1 year ago

2.4.4

1 year ago

2.4.10

1 year ago

2.4.12

1 year ago

2.4.11

1 year ago

2.4.7

1 year ago

2.4.6

1 year ago

2.4.9

1 year ago

2.4.8

1 year ago

2.4.3

1 year ago

2.4.2

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.3.11

1 year ago

2.3.10

1 year ago

2.3.9

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.2

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago