> For the complete documentation index, see [llms.txt](https://docs.digia.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digia.tech/digia-engage/developer-guides/inline-content.md).

# Managing Inline Content

**Inline content** is the campaign UI that Digia Engage renders *inside* your screen layout — carousels, stories, banners, and countdowns — through a `DigiaSlot` / `DigiaSlotView` placement. Unlike a nudge or a guide, it isn't an overlay the user dismisses; it lives in the page like any other widget.

Because of that, inline content has a lifecycle you sometimes need to manage from app code. This page explains how it persists and how to clear it.

{% hint style="info" %}
The `clearInlineContent` and `clearAllInlineContent` APIs live on the Digia Engage **core SDK** and behave the same on every stack — React Native, Android, iOS, and Flutter. They are independent of which CEP (CleverTap, MoEngage, WebEngage) delivered the campaign.
{% endhint %}

***

## 1. How inline content persists

When an inline campaign becomes active, the SDK loads its content into the matching slot and **keeps it there**. It survives scrolling, widget rebuilds, and navigating away and back, so it doesn't flicker or vanish while the user moves around the app.

Loaded inline content clears only in two situations:

* **The server invalidates the campaign** — for example it expires or is stopped.
* **You clear it explicitly** — with the APIs below.

The important consequence: **inline content does not clear on its own when the user's context changes.** If a user logs out, a banner or carousel that was personalized for them stays on screen until you clear it — so the next user could see the previous user's content.

***

## 2. When to clear it

The canonical case is a **logout or account switch**: clear the previous user's inline content so it doesn't linger into the next session.

More generally, clear inline content whenever app state changes such that the currently loaded content is no longer valid for the current user — for example switching profiles, changing region or language, or leaving a section whose inline campaigns shouldn't persist elsewhere.

***

## 3. The API

Two methods on `Digia`:

| Method                    | What it clears                                |
| ------------------------- | --------------------------------------------- |
| `clearInlineContent(...)` | Inline content in the placement keys you pass |
| `clearAllInlineContent()` | Inline content across **every** placement     |

The placement keys are the same `placementKey` values you gave your `DigiaSlot` / `DigiaSlotView`. Both methods are **safe to call anytime** — clearing a placement that has no active content (or passing no keys) is a no-op.

Clearing removes the content that's currently loaded; it does **not** disable the slot. A new campaign can populate the same placement again later.

***

## 4. Clear on logout

The most common use. Clear everything as part of your logout / account-switch flow, next to where you reset your own user state.

{% tabs %}
{% tab title="React Native" %}

```tsx
import { Digia } from '@digia-engage/core';

// In your logout / account-switch handler:
function onLogout() {
  Digia.clearAllInlineContent();
  // ...reset your own app + auth state
}
```

{% endtab %}

{% tab title="Android" %}

```kotlin
import com.digia.engage.Digia

// In your logout / account-switch handler:
fun onLogout() {
    Digia.clearAllInlineContent()
    // ...reset your own app + auth state
}
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
import DigiaEngage

// In your logout / account-switch handler (main thread):
func onLogout() {
    Digia.clearAllInlineContent()
    // ...reset your own app + auth state
}
```

{% endtab %}

{% tab title="Flutter" %}

```dart
import 'package:digia_engage/digia_engage.dart';

// In your logout / account-switch handler:
void onLogout() {
  Digia.clearAllInlineContent();
  // ...reset your own app + auth state
}
```

{% endtab %}
{% endtabs %}

***

## 5. Clear specific placements

When you only need to clear some slots — for example a personalized hero banner while leaving generic promotional slots in place — pass their placement keys.

{% tabs %}
{% tab title="React Native" %}

```tsx
// One placement:
Digia.clearInlineContent('home_hero_banner');

// Several at once:
Digia.clearInlineContent('home_hero_banner', 'product_offers');
```

{% endtab %}

{% tab title="Android" %}

```kotlin
// One placement:
Digia.clearInlineContent("home_hero_banner")

// Several at once:
Digia.clearInlineContent("home_hero_banner", "product_offers")
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
// One placement:
Digia.clearInlineContent("home_hero_banner")

// Several at once:
Digia.clearInlineContent("home_hero_banner", "product_offers")
```

{% endtab %}

{% tab title="Flutter" %}

```dart
// One placement:
Digia.clearInlineContent(['home_hero_banner']);

// Several at once:
Digia.clearInlineContent(['home_hero_banner', 'product_offers']);
```

{% endtab %}
{% endtabs %}

***

## 6. Use it correctly

* **Wire it into logout / account switch.** This is the case that matters most — a previous user's personalized inline content should not carry into the next user's session. Call it alongside your own session reset.
* **Match your placement keys exactly.** The keys you pass are your `DigiaSlot` `placementKey` values and are case-sensitive. A key that doesn't match an active slot is a no-op.
* **It clears, it doesn't disable.** After clearing, the slot collapses to zero height, but the placement stays live — a later campaign can render into it again.
* **It's inline-only.** These APIs affect inline content (carousels, stories, banners, countdowns). Nudges, guides, and surveys are overlays with their own lifecycle and are not affected.
* **No-op safety.** Calling with no active content, unknown keys, or no keys does nothing and is safe to call defensively.

## Related pages

* [Core Concepts](/digia-engage/start-here/core-concepts.md)
* [Campaign Actions](/digia-engage/developer-guides/campaign-actions.md)
* [Developer Integrations](/digia-engage/developer-guides/developer-integrations.md)
