This repository contains example applications that demonstrate how to integrate and use Cognipeer's APIs and client libraries in various environments and use cases.
Cognipeer provides powerful AI assistant capabilities through its API and client libraries. These examples show developers how to:
- Connect to Cognipeer API services
- Interact with AI assistants (peers)
- Create and manage conversations
- Build interactive interfaces for AI communication
- Implement tool integration for enhanced AI capabilities
A React-based chat interface example built with Next.js that demonstrates the core functionality of the @cognipeer/client-js package:
- Modern user interface built with Next.js and Tailwind CSS
- Real-time messaging with AI assistants
- Configuration panel for API settings
- Complete message history and conversation management
More examples will be added to demonstrate different integration scenarios, including:
- Vanilla JavaScript implementation
- React Native mobile application
- Node.js backend integration
- Tool integration examples
- Custom AI assistant configuration
Each example contains its own README with specific instructions. Generally, to run any example:
- Navigate to the example directory:
cd examples/[example-name]- Install dependencies:
npm install-
Configure environment variables (usually in a
.env.localfile) -
Start the application:
npm run devAll examples use the @cognipeer/client-js npm package, which provides:
- Type definitions for Cognipeer API entities
- Client implementation for API calls
- Promise-based interface for asynchronous operations
import CognipeerClient from '@cognipeer/client-js';
// Initialize the client
const client = new CognipeerClient({
baseUrl: 'https://api.cognipeer.com/v1/client',
token: 'optional-token'
});
// List available AI assistants
const peers = await client.peer.list();
// Create a conversation
const conversation = await client.conversation.create('peer-id');
// Send a message
const response = await client.conversation.sendMessage('conversation-id', 'Hello, world!');MIT
We welcome contributions! Feel free to submit pull requests with new examples or improvements to existing ones.