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

# Frontend SDKs Overview

> Pre-built UI components for managing integrations in your frontend applications

Suada provides official frontend SDKs with pre-built UI components to help you quickly add integration management to your applications. Choose the SDK that matches your frontend framework:

## Available Frontend SDKs

<CardGroup cols={2}>
  <Card title="React SDK" icon="react" href="/sdks/react">
    Modern React components with hooks and TypeScript support

    <ul className="mt-2">
      <li>React 18+ support</li>
      <li>Custom hooks for state management</li>
      <li>Styled components integration</li>
      <li>LangChain integration</li>
    </ul>
  </Card>

  <Card title="Next.js SDK" icon={<img src="/images/nextjs.svg" />} href="/sdks/next">
    Server-side rendering and App Router support

    <ul className="mt-2">
      <li>Next.js 13+ support</li>
      <li>Server Components</li>
      <li>API route handlers</li>
      <li>Tailwind CSS integration</li>
    </ul>
  </Card>

  <Card title="Angular SDK" icon="angular" href="/sdks/angular">
    Enterprise-ready Angular components and services

    <ul className="mt-2">
      <li>Angular 17.3+ support</li>
      <li>Injectable services</li>
      <li>Standalone components</li>
      <li>TypeScript support</li>
    </ul>
  </Card>

  <Card title="Vue SDK" icon="vuejs" href="/sdks/vue">
    Vue 3 components with composables

    <ul className="mt-2">
      <li>Vue 3.0+ support</li>
      <li>Composition API</li>
      <li>TypeScript support</li>
      <li>Vite integration</li>
    </ul>
  </Card>

  <Card title="React Native SDK" icon="mobile" href="/sdks/react-native">
    Native mobile components for iOS and Android

    <ul className="mt-2">
      <li>React Native 0.73+ support</li>
      <li>Deep linking support</li>
      <li>Native UI components</li>
      <li>Expo compatibility</li>
    </ul>
  </Card>

  <Card title="Vanilla JS SDK" icon="js" href="/sdks/vanilla">
    Framework-agnostic JavaScript implementation

    <ul className="mt-2">
      <li>No framework dependencies</li>
      <li>Modern browser support</li>
      <li>CDN availability</li>
      <li>UMD/ESM formats</li>
    </ul>
  </Card>
</CardGroup>

## Getting Started

### Prerequisites

Before you begin, ensure you have:

* A Suada API key
* Node.js 16.0.0 or higher
* A modern web browser
* Your preferred package manager (npm, yarn, or pnpm)

### Installation

Choose your preferred SDK and install it:

```bash theme={null}
# React
npm install @suada/react @suada/core

# Next.js
npm install @suada/next @suada/core

# Angular
npm install @suada/angular @suada/core

# Vue
npm install @suada/vue @suada/core

# React Native
npm install @suada/react-native @suada/core

# Vanilla JS
npm install @suada/vanilla @suada/core
```

### Environment Setup

Set up your environment variables based on your framework:

```env theme={null}
# React/Vue/Angular
VITE_SUADA_API_KEY=your-api-key
VITE_SUADA_BASE_URL=https://api.suada.ai

# Next.js
NEXT_PUBLIC_SUADA_API_KEY=your-api-key
NEXT_PUBLIC_SUADA_BASE_URL=https://api.suada.ai

# React Native
SUADA_API_KEY=your-api-key
SUADA_BASE_URL=https://api.suada.ai
```

## Core Features

### 🔒 OAuth Integration Flow

The SDKs provide a seamless OAuth integration experience:

<Frame>
  <img src="https://mintcdn.com/suada/Z5N2Gi_GHKmDYt5h/images/oauth-preview.png?fit=max&auto=format&n=Z5N2Gi_GHKmDYt5h&q=85&s=12d8fcb91a2c8c8922fc3b0cf0fe5d9c" alt="OAuth Integration Flow" width="3678" height="2758" data-path="images/oauth-preview.png" />
</Frame>

1. **Initialize Connection**
   * User clicks connect button
   * SDK handles OAuth redirect
   * Secure token exchange

2. **Authorization**
   * User authenticates with provider
   * Secure callback handling
   * Token management

3. **Integration Complete**
   * Success confirmation
   * Ready to use

### 🎨 UI Components

All SDKs provide these core components:

#### Integration Button

A customizable button for connecting services:

<CodeGroup>
  ```jsx React theme={null}
  <IntegrationButton
    provider="notion"
    redirectUri="https://your-app.com/callback"
    onSuccess={handleSuccess}
    onError={handleError}
  >
    Connect Notion
  </IntegrationButton>
  ```

  ```tsx Next.js theme={null}
  <IntegrationButton
    provider="notion"
    redirectUri="https://your-app.com/callback"
    onSuccess={handleSuccess}
    onError={handleError}
  >
    Connect Notion
  </IntegrationButton>
  ```

  ```typescript Angular theme={null}
  <suada-integration-button
    [provider]="'notion'"
    [redirectUri]="'https://your-app.com/callback'"
    (success)="handleSuccess($event)"
    (error)="handleError($event)">
    Connect Notion
  </suada-integration-button>
  ```

  ```vue Vue theme={null}
  <SuadaIntegrationButton
    provider="notion"
    redirect-uri="https://your-app.com/callback"
    @success="handleSuccess"
    @error="handleError"
  >
    Connect Notion
  </SuadaIntegrationButton>
  ```
</CodeGroup>

#### Integration List

Display and manage connected integrations:

<CodeGroup>
  ```jsx React theme={null}
  <IntegrationList
    filter={{ provider: 'notion' }}
    layout="grid"
    onSelect={handleSelect}
    onDelete={handleDelete}
  />
  ```

  ```tsx Next.js theme={null}
  <IntegrationList
    filter={{ provider: 'notion' }}
    layout="grid"
    onSelect={handleSelect}
    onDelete={handleDelete}
  />
  ```

  ```typescript Angular theme={null}
  <suada-integration-list
    [filter]="{ provider: 'notion' }"
    [layout]="'grid'"
    (select)="handleSelect($event)"
    (delete)="handleDelete($event)">
  </suada-integration-list>
  ```

  ```vue Vue theme={null}
  <SuadaIntegrationList
    :filter="{ provider: 'notion' }"
    layout="grid"
    @select="handleSelect"
    @delete="handleDelete"
  />
  ```
</CodeGroup>

## Best Practices

### Security

* Store API keys in environment variables
* Use HTTPS for all API calls
* Implement proper error handling
* Secure OAuth callback endpoints
* Validate user sessions

### Performance

* Lazy load components
* Implement proper cleanup
* Handle offline scenarios
* Optimize network requests
* Use proper caching

### Development

* Use TypeScript for type safety
* Follow framework best practices
* Write unit tests
* Keep dependencies updated
* Use proper error boundaries

## Common Use Cases

### Basic Integration Setup

1. **Install SDK**
   ```bash theme={null}
   npm install @suada/react @suada/core
   ```

2. **Configure Provider**
   ```typescript theme={null}
   import { SuadaProvider } from '@suada/react';

   function App() {
     return (
       <SuadaProvider config={{
         apiKey: process.env.SUADA_API_KEY
       }}>
         <YourApp />
       </SuadaProvider>
     );
   }
   ```

3. **Add Components**
   ```jsx theme={null}
   <IntegrationButton provider="notion" />
   ```

## Framework-Specific Features

### Next.js

* Server Components support
* API route handlers
* App Router compatibility
* Tailwind CSS integration

### React

* Custom hooks
* Context API integration
* Styled components
* LangChain support

### Angular

* Injectable services
* Standalone components
* Dependency injection
* RxJS integration

### Vue

* Composition API
* Vite integration
* Vue Router support
* Pinia integration

### React Native

* Native UI components
* Deep linking
* Platform-specific optimizations
* Expo compatibility

## FAQ

### How do I handle OAuth callbacks?

1. Set up your callback URL in the Suada dashboard
2. Configure the redirect URI in your component
3. Handle the callback in your application

```typescript theme={null}
// Example callback handler
const handleCallback = async (code: string) => {
  try {
    await suada.handleOAuthCallback(code);
    // Handle success
  } catch (error) {
    // Handle error
  }
};
```

### How do I debug integration issues?

1. Enable debug mode
2. Check network requests
3. Validate OAuth flow

```typescript theme={null}
// Enable debug mode
const suada = new Suada({
  debug: true,
  logger: console.log
});
```

### How do I handle offline scenarios?

1. Implement proper error handling
2. Use retry mechanisms
3. Cache responses

```typescript theme={null}
// Example offline handling
const handleRequest = async () => {
  try {
    return await suada.request();
  } catch (error) {
    if (error.code === 'OFFLINE') {
      // Handle offline scenario
    }
  }
};
```

## Support & Resources

### Documentation

* [API Reference](/api-reference)

### Support

* Email Support: [hello@suada.ai](mailto:hello@suada.ai)
