React Native
API Reference
Complete API reference for the React Native SDK
API Reference
Components
MutaRoot
The root component that initializes the SDK and manages placements.
Props
Prop | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | Your Muta API key |
Methods
Muta.displayPlacement()
Displays a placement in a modal overlay.
Options
Option | Type | Required | Description |
---|---|---|---|
placementId | string | Yes | The ID of the placement to display |
loadingScreen | React.ReactNode | No | A custom React component to show while the placement is loading |
bgColor | string | Yes | Background color that matches your first placement screen. This creates a seamless transition between your app and the placement. |
presentationType | 'slide' | 'fade' | 'none' | No | Animation style when showing the placement. Defaults to ‘slide’. |
Muta.on()
Subscribe to Muta events.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
eventType | MutaEventType | Yes | The type of event to listen for. Use ’*’ to listen to all events. |
callback | MutaEventCallback | Yes | The callback function to be called when the event occurs. |
Returns
An object with a remove
method to unsubscribe from the event.
Types
MutaEvent
Base interface for all Muta events.