# lowcoder-sdk
## Usage
yarn:
```bash
yarn add lowcoder-sdk
```
npm:
```bash
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
```ts
import "lowcoder-sdk/dist/style.css";
```
### For react app:
```ts
import { LowcoderAppView } from "lowcoder-sdk";
;
```
#### LowcoderViewProps
| Name | Type | Description | Default value |
|------------------------|-----------------------------|-----------------------------------------------------------------------------------------|---------------|
| appId | string | The app's id in Lowcoder. Required! | -- |
| baseUrl | string | Lowcoder's api base url | -- |
| onModuleEventTriggered | (eventName: string) => void | Triggered when module's custom event is triggered. Works only when the app is a module. | -- |
| onModuleOutputChange | (output: any) => void | Triggered when module's outputs change. Works only when the app is a module. | -- |
#### Invoke module methods
```tsx
import { useRef } from "ref";
import { LowcoderAppView } from "lowcoder-sdk";
function MyExistingAppPage() {
const appRef = useRef();
return (