A set of React components for seamlessly integrating Lateral content into your application.
npm install @lateral-ai/ui-reactA set of React components for seamlessly integrating Lateral content into your application.
``bash`
npm install @lateral-ai/ui-react @lateral-ai/telemetry
Before using the UI components, you need to initialize both the Telemetry and UI libraries:
`javascript
import { initTelemetry } from "@lateral-ai/telemetry";
import LateralUI from "@lateral-ai/ui-react";
// Initialize telemetry
const client = initTelemetry({
apiKey: LATERAL_API_KEY,
userId: user.id,
mode: LATERAL_MODE,
});
// Initialize UI
LateralUI.init(client);
`
This initialization sets up the Lateral telemetry client and prepares the UI components for use.
Once initialized, you can use the components in your React application:
`jsx
import LateralUI from "@lateral-ai/ui-react";
// ... in your component
return (
My content
Default text if backend is not reachable
);
`
The LateralUI.Frame` component allows you to easily integrate the content you've created in Lateral into your application.
- @lateral-ai/telemetry: Telemetry package for Lateral, required for UI initialization.
For any issues or questions, please contact support or open an issue in this repository.