Skip to content

3 - Add X3M SDK and Loomit adapters to your app

Add the npm package

add the package react-native-xmediator to your app.

yarn:

yarn add https://react-native-artifact-registry.x3mads.com/react-native/react-native-xmediator-0.2.0.tgz

npm:

npm install https://react-native-artifact-registry.x3mads.com/react-native/react-native-xmediator-0.2.0.tgz

Info

We're working on adding the package to the npm registry. Please be patient 🙏.

Add the native SDK dependencies to your app.

Pick networks you want to add to your app.

Configure the XMediator provider

In the root of your app, usually in the App.tsx file, add the following code:

import { XMediatorProvider } from "react-native-xmediator";

export default function App() {
  return (
    <XMediatorProvider
      appKey={"<YOUR_APP_KEY>"}
      // other props
    >
      {/* your app code... */}
    </XMediatorProvider>
  );
}

Tip

The XMediatorProvider has a autoInitialize prop (default: true). If set to false, you will need to use a useInitialize hook.