> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Framework Initialization

# Initialize React-Native Component

Initialize the MoEngage Plugin in the **App.js** or ***App***\*.\*\*\****ts*** of your application once the component is mounted.

<CodeGroup>
  ```java TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import ReactMoE from 'react-native-moengage';
  ReactMoE.initialize("YOUR_Workspace_ID");
  ```
</CodeGroup>

**Example**

<CodeGroup>
  ```java TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import ReactMoE from 'react-native-moengage';
  useEffect(() => {
      ReactMoE.initialize("YOUR_Workspace_ID");
  }, []);
  ```
</CodeGroup>

<Info>
  If you have a class-based component then you can initialize in the ***render()*** or ***componentDidMount()***
</Info>

## Initialize with Configuration (optional)

<CodeGroup>
  ```java TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import ReactMoE from 'react-native-moengage';
  import { MoEInitConfig, MoEPushConfig, MoEngageLogConfig, MoEngageLogLevel } from "react-native-moengage";
  const moEInitConfig = new MoEInitConfig(
    MoEPushConfig.defaultConfig(),
    new MoEngageLogConfig(MoEngageLogLevel.DEBUG, isEnabledForReleaseBuild)
  );
  ReactMoE.initialize(YOUR Workspace ID, moEInitConfig);
  ```
</CodeGroup>

<Warning>
  Make sure you are setting the Push/InApp callback listeners before calling the ***initialize()***.
</Warning>

Refer to the following for platform-specific initialization:

* [Android](/developer-guide/react-native-sdk/sdk-integration/react-native/sdk-initialization/manual-initialization/android)
* [iOS](/developer-guide/react-native-sdk/sdk-integration/react-native/sdk-initialization/manual-initialization/ios)

For more information about samples, refer to [React-Native Sample App](https://github.com/moengage/React-Native-Sample-App/tree/master).
