> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrativebanking.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture overview

> External boundary architecture and integration flow for Narrative SDK.

## External integration boundaries

<div className="zoomable-diagram">
  ```mermaid theme={null}
  flowchart LR
    subgraph Tenant["Tenant application boundary"]
      TB["Tenant backend<br/>Embed Token minting"]
      TF["Tenant frontend<br/>Host page + app UI"]
    end

    subgraph NSDK["Narrative SDK boundary"]
      LOADER["SDK loader + embedded widget"]
      API["NSDK API"]
      CORE["Narrative platform internals (black box)"]
    end

    TB -->|Short-lived Embed Token| TF
    TF -->|Load SDK + set token| LOADER
    LOADER -->|Authenticated capability requests| API
    API --> CORE
    CORE --> API
    API -->|Responses and streaming updates| LOADER
    LOADER --> TF
  ```
</div>

## Integration flow

<Steps>
  <Step title="Mint Embed Token in tenant backend">
    The tenant backend creates a short-lived Embed Token for the currently authenticated tenant user.
  </Step>

  <Step title="Initialize the embedded widget from tenant frontend">
    The tenant frontend loads the SDK and passes the Embed Token to the NSDK container.
  </Step>

  <Step title="Call NSDK capabilities through documented integration patterns">
    The embedded widget exchanges authenticated requests with NSDK and renders responses in the host experience.
  </Step>

  <Step title="Operate through stable external contracts">
    Tenant teams integrate against published behaviour and documentation, while the underlying platform architecture remains abstracted behind the NSDK boundary.
  </Step>
</Steps>

<Note>
  For production integration, pair this page with [Tenant embedding guide](/sdk/tenant-embedding-guide), [Configuration reference](/sdk/configuration), and [Security posture](/architecture/security).
</Note>
