Contents

Cancel

Recommended Articles

  1. unify-apps

    Indexing

    Unify AI

    Transform raw content into searchable knowledge through AI-powered indexing and vector embeddings

  2. unify-apps

    IMAP

    Unify Integrations

    Integrate your app with IMAP to enable seamless email synchronization, real-time access, and enhanced communication workflows.

  3. unify-apps

    Preview Your Work

    Unify Automations

    Effortlessly review & monitor your automation’s performance

  4. unify-apps

    QuickBooks

    Unify Integrations

    Integrate your app with QuickBooks to streamline accounting, automate invoicing, and manage finances effortlessly

  5. unify-apps

    FTP/FTPS

    Unify Integrations

    Connect your app with FTP/FTPS to automate secure file transfers and streamline data exchange across systems.

  6. unify-apps

    Snowflake

    Unify Automations

    Connect to Snowflake for fast, scalable cloud data warehousing and analytics

  7. unify-apps

    Button

    Unify Applications

    Create interactive elements with ease using buttons

  8. unify-apps

    BambooHR

    Unify Automations

    Integrate your app with BambooHR to streamline HR management, automate employee data processing, and enhance onboarding workflows

  9. unify-apps

    Build your first automation

    Unify Automations

    Learn how to build your automation step by step

  10. unify-apps

    User Management

    Unify Applications

    Efficiently manage user roles and permissions

  11. unify-apps

    Microsoft Teams

    Unify Automations

    Connect your app with Microsoft Teams to enhance communication, automate workflows, and foster collaboration across your organization

  12. unify-apps

    Jira

    Unify Automations

    Use Jira to plan, track, and manage your agile and software development projects

  13. unify-apps

    Pre Processing

    Unify AI

    Optimize query processing through intelligent rephrasing, retrieval, and ranking to deliver accurate AI responses

  14. unify-apps

    Google Calendar

    Unify Integrations

    Integrate your app with Google Calendar to streamline scheduling, automate event management, and improve team coordination

  15. unify-apps

    SAP HANA

    Unify Integrations

    Connect your app with SAP HANA to leverage in-memory computing for real-time data processing and advanced analytics at scale.

#
Unify Integrations
Logo
Platform Embed

Platform Embed

Logo

4 mins READ

Installation

To install the package, use npm:

npm install @unifyapps/platform-react

Usage

Rendering a module

Render UAProvider, and pass the necessary props. Then, use the ConnectionManager, AutomationManager, or Connectors component to render the UI.

import React from 'react';
import ReactDOM from 'react-dom';
import { UAProvider, ConnectionManager } from '@unifyapps/platform-react';
// Configuration options for the platform connection
const options = {
  host: '<HOST_NAME>',
  token: '<IDP_ID>/<SESSION_ID>',
};
// Example: { host: 'https://platform.unifyapps.com', token: '123456789/123456789' }
// Full size style for the connection manager component
const FULL_SIZE = { width: '100%', height: '100%' };
// Main App component
const App = () => (
  <UAProvider options={options}>
    <ConnectionManager style={FULL_SIZE} />
  </UAProvider>
);
// Render the App component to the root element
ReactDOM.render(<App />, document.getElementById('root'));

Props

  • UAProvider:

    • options: An object containing configuration options for the provider.

      • host: The base URL of the host application.

      • token: The temporary session id to authenticate the user

  • UI Components:

    • ConnectionManager

    • AutomationManager

    • Connectors

  • UI Components Props:

    • id (optional): to load specific entity.

    • style (optional): Inline styles for the container.

    • className (optional): CSS class name for the container.

How to get the HOST_NAME?

Host name is the same as the URL of the platform application. For example, if the platform application is hosted at `https://platform.unifyapps.com`, then the host would be `https://platform.unifyapps.com`.

How to get the ACCESS_TOKEN?

Using NodeJS

const URL = '<HOST_NAME>/auth/createUserExternalLoginSession';
const AUTH_TOKEN = '<AUTH_TOKEN>';
const data = {
  identityProviderId: '<IDP_ID>',
  formData: {
    username: '<USER_NAME>',
    name: '<NAME>',
    email: '<USER_EMAIL>',
  },
};
// Make a POST request to create a user session
async function makeRequest() {
  try {
    const response = await fetch(URL, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${AUTH_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(data),
    });
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    const responseData = await response.json();
    // Sample responseData: {"redirectUrl":"<HOST_NAME>/auth/external/login?sessionId=<SESSION_ID>&identityProviderId=<IDP_ID>","sessionId":"..."}
    console.log('Success:', responseData);
    return responseData;
  } catch (error) {
    console.error('Error:', error);
  }
}
// Pass this sessionId to the UAProvider options
const { sessionId } = await makeRequest();

How to get the required parameters. Contact support@unifyapps.com

1. HOST_NAME

2. AUTH_TOKEN

3. IDP_ID

4. NPM details: To access the package, you need to have these npm package details, since it's a private repo.