SDK Structure
The SDK is accessed through the main OpenWeb class, which provides a static manager instance that serves as the central point for configuration and accessing SDK functionality.
The SDK provides two main UI components for displaying conversations:
- OpenWebConversation - Displays the full conversation experience with comments, reactions, and user interactions.
- OpenWebPreConversation - Shows a preview of the conversation before users engage with the full view.
The manager provides access to two main subsystems:
- Authentication (
OpenWeb.manager.authentication) - Handles user authentication and SSO flows. - Analytics (
OpenWeb.manager.analytics) - Provides access to analytics events and custom BI data. - Customizations (
OpenWeb.manager.customizations) - Allows customization of the SDK's appearance including theme colors, color formats, and sort strategies.
SDK Initialization
Set up the SpotID
Your spotId is provided by your PSM. This ID is crucial as it is the primary identifier for interactions. The manager assists in setting this spotId.
It's imperative to set the
spotIdvia the manager before invoking any other part of the API.
import React, { useEffect } from 'react';
import { OpenWeb } from 'react-native-openweb-sdk';
function App() {
useEffect(() => {
// Initialize SDK with your OpenWeb Spot ID
OpenWeb.manager.setSpotId('sp_YOUR_SPOT_ID');
}, []);
return (
// Your app components
);
}
export default App;Updated about 4 hours ago
