Key-Values in Linked Paywalls

Control any fields in your Linked Paywall from the cloud.

Your custom-designed paywall may have functionality and elements that are very different from what we offer in our Paywall Creator paywalls on the platform. In this situation, we have provided a general framework to allow you to enable cloud-based controls of functionality and design of your paywall from the Control Center.

This is provided via a cloud interface that allows you to define arbitrary key-value pairs that Nami will send to the SDK. To see how this works in the Control Center, read this guide.

The key-value pairs are sent to the SDK as a JSON that is accessible when working with Linked Paywall data.

useEffect(() => {
  // listen for the AppPaywallActivate event and call a function
  eventEmitter.addListener('AppPaywallActivate', onPaywallShouldRaise);
}
          
const onPaywallShouldRaise = (event) => {
  // check if any key-values are available
  if (event["paywallMetadata"]["marketing_content"]["extra_data"] === undefined) {
    console.log("No key-values defined in Control Center.")
  } else {
    // access and use key-values in this JSON
    console.log("Extra Data: ", event["paywallMetadata"]["marketing_content"]["extra_data"])
  }

  // add code to present your paywall here 
}