App Builder Bridge

WebView ↔ Flutter SDK

Bridge Your WebView to Flutter

A powerful SDK that enables seamless communication between your web application and Flutter native apps. Access native features like push notifications, secure storage, and device capabilities from JavaScript.

Quick Start

1. Install the SDK

npm install @aisahub/app-builder-sdk

2. Import and Check Environment

import AppBridge from '@aisahub/app-builder-sdk';

if (AppBridge.isInApp()) {
  console.log('Running in app environment');
  // Use native features
} else {
  console.log('Running in browser');
  // Use web alternatives
}

3. Understanding the Result Interface

All SDK methods return a Promise with a standardized Result<T> structure:

interface Result<T> {
  success: boolean;  // Operation status
  error?: string;    // Error message if failed
  data?: T;          // Response data if successful
}

4. Use the Promise-based API

// All methods return Promises with Result structure
async function setupNotifications() {
  try {
    const result = await AppBridge.generateFcmToken();
    if (result.success && result.data) {
      console.log('FCM Token:', result.data.token);
      // Send to your backend
      await saveToBackend(result.data.token);
    }
  } catch (error) {
    console.error('Error:', error.error);
  }
}

Powerful Features

Push Notifications

Generate FCM tokens and manage push notification subscriptions seamlessly.

Secure Storage

Store sensitive data with encrypted native storage on the device.

Device Info

Access device model, OS version, and platform information.

Share Content

Open native share dialogs to share content across apps.

Location Services

Request permissions and get current location coordinates.

TypeScript Support

Full TypeScript definitions for better development experience.

Why Choose App Builder Bridge?

Promise-Based API

const result = await AppBridge.method();

Modern async/await syntax with standardized Result structure

TypeScript Support

Result<T> with full type safety

Complete TypeScript definitions for better DX

React Hooks

useAppBridge(), useSecureStorage()

Pre-built hooks for seamless React integration