intafaceai v1.0.0
Interface Agent Component Documentation
This Agent component provides a dynamic and interactive chat interface inspired by modern DeFi DApps. It supports user-to-assistant interactions, system error handling, and a sleek UI design.
A simple, customizable chat interface for React/Next.js applications. This component provides an easy way to integrate a chat interface into your project, designed to allow communication with a backend service using a projectId and apiKey.
Installation
To use the Interface Agent in your project, first install it via npm:
npm install interface-ai@2.2.2
Usage in React or Next.js
After installing the package, import the Agent component into your React or Next.js project: Example in a React Project
import React from "react"; import { Agent } from "interface-agent";
function App() { const projectId = "your_project_id"; // Replace with your actual project ID const apiKey = "your_api_key"; // Replace with your actual API key
return (
<div className="App">
<Agent projectId={projectId} apiKey={apiKey} />
</div>
); }
export default App;
Props Required Props
Prop |Type |Description | ___|___|___| projectId |String |Your unique project ID. Obtain it from Interface.com. | ___|___|___| apiKey |String |Your API key for authentication. Obtain it from Interface.com. | ___|___|___|
Obtaining projectId and apiKey
To use this library, you need to have a valid projectId and apiKey. Follow these steps:
- Visit Interface.com.
- Sign up or log in to your account.
- Navigate to your Developer Dashboard.
- Create a new project or use an existing one to generate your projectId and apiKey.
9 months ago