react-native-chatgpt  by rgommezz

React Native SDK for ChatGPT integration

created 2 years ago
577 stars

Top 56.8% on sourcepulse

GitHubView on GitHub
Project Summary

This library provides a React Native wrapper for OpenAI's ChatGPT, enabling seamless integration of conversational AI into mobile applications. It targets React Native developers seeking to add chatbot functionality without a backend server, offering features like authentication handling, streamed responses, and conversation history management.

How It Works

The library leverages a client-side approach, utilizing react-native-webview to interact directly with the ChatGPT web interface for authentication and communication. This avoids the need for a custom backend, simplifying integration. It manages authentication tokens and conversation state, allowing for context-aware interactions by passing conversationId and messageId with subsequent requests.

Quick Start & Requirements

  • Install via npm: npm install react-native-chatgpt
  • Additional dependencies: react-native-webview, expo-secure-store (for Expo) or react-native-vector-icons (for bare React Native).
  • Expo users: npx expo install react-native-webview expo-secure-store
  • Bare React Native users: npm install react-native-webview react-native-vector-icons expo-secure-store
  • Official Snack example available for quick testing.

Highlighted Details

  • 100% client-side integration, eliminating backend requirements.
  • Supports streaming responses for a real-time chat experience.
  • Type-safe implementation using TypeScript.
  • Handles ChatGPT authentication flow via a modal.
  • Conversation history is maintained by passing IDs.

Maintenance & Community

  • The project is maintained by Raul Gomez Acuna.
  • No specific community channels (Discord/Slack) or roadmap links are provided in the README.

Licensing & Compatibility

  • MIT License.
  • Permissive license suitable for commercial use and integration into closed-source applications.

Limitations & Caveats

The library is marked as experimental and should be used with caution in production. ChatGPT's backend implements rate limiting, which may lead to 429 errors if messages are sent too frequently. Authentication tokens expire weekly, requiring re-authentication.

Health Check
Last commit

2 years ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
6 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.