Skip to content

React Native SDK

Add AI-powered chat support to your React Native mobile applications.

What is the Lingu SDK?

The Lingu React Native SDK provides a drop-in chat component for your mobile apps. It uses a hybrid architecture combining the flexibility of WebView for UI with native API calls for performance.

Key Features

FeatureDescription
Full-Page Chat UIImmersive full-screen chat experience
Message PersistenceConversations saved locally and restored automatically
Hybrid ArchitectureWebView UI with native API performance
Easy IntegrationDrop-in component for React Native apps
Session ManagementAutomatic session handling and heartbeat
CustomizableFull control over colors, position, and behavior
TypeScriptFull type safety
Cross-platformWorks on iOS and Android

Architecture

The SDK uses a hybrid approach:

mermaid
flowchart TB
    subgraph Mobile App
        A[LinguChat Component]
        B[WebView UI]
        C[Native API Client]
    end
    
    D[Lingu API]
    
    A --> B
    A --> C
    C --> D
    D --> C
    B -.-> A
  • WebView UI: Renders the chat interface for consistent styling
  • Native API: Handles network requests for better performance
  • Local Storage: Persists messages using AsyncStorage

Requirements

RequirementVersion
React Native≥ 0.70
iOS≥ 13.0
Android≥ 21 (Android 5.0)

Quick Start

bash
npm install @lingu/react-native-sdk react-native-webview @react-native-async-storage/async-storage
tsx
import { LinguChat } from '@lingu/react-native-sdk';

<LinguChat apiKey="your-api-key-here" />

Next Steps

Installation Guide

Set up the SDK in your React Native project.

Widget Component

Learn how to use the LinguChat component.

WebView Integration

Understand the hybrid architecture.

Powered by Lingu