Integration guide


Using npm:

npm install --save react-native-outbrain

Using yarn:

yarn add react-native-outbrain


Import Outbrain Module

import { OutbrainWidget } from 'react-native-outbrain'

OutbrainWidget Component


Getting IDFA

Using react-native-idfa, get the user idfa to pass to the userId prop:

import { IDFA } from 'react-native-idfa';

componentDidMount() {
  IDFA.getIDFA().then((idfa) => {
    this.setState({ idfa, });
  .catch((e) => {

Displaying a SmartFeed widget

In order to display a SmartFeed widget, follow those steps:

Save a reference to the OutbrainWidget

Save a reference to the OutbrainWidget to use it for loading more items to the feed:

  ref={input => this.outbrainWidget = input}

Detect scroll to bottom in your ScrollView

Detect scroll to bottom in your ScrollView to load more items to the OutbrainWidget feed when reaching the bottom of the screen, for example:

isCloseToBottom ({layoutMeasurement, contentOffset, contentSize}) {
  const paddingToBottom = 50;
  return layoutMeasurement.height + contentOffset.y >= contentSize.height - paddingToBottom;

  onMomentumScrollEnd={({nativeEvent}) => {
    if (this.outbrainWidget && this.isCloseToBottom(nativeEvent)) {
      this.outbrainWidget.loadMore() // load more items to OutbrainWidget feed


GDPR \ CCPA Support

Use the following props to pass OutbrainWidget the GDPR or CCPA string from your app code.

For GDPR consent V2 use consentV2 For CCPA string use ccpaString. For example:


Style the WebView

You can pass a style for the WebView to customize its style (width, add padding, etc.) For example:

  style={{width: screenWidth * 0.9}}

Dark mode support

To enable dark mode, set darkMode prop to true:


Organic recommendation click listener

Using the onOrganicClick prop, you can set a callback to get the organic url, for example:

  onOrganicClick={orgUrl => console.log("In App - click on: " + orgUrl)}