
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
react-native-openai
Advanced tools
The goal is to make this library take advantage of the native APIs like URLSession and Android's Ktor engine for better performance and reliability.
If you would like to contribute, please join our Discord and ask questions in the #oss channel or create a pull request.
Requires iOS 15+ and Android minSdkVersion = 24.
yarn add react-native-openai
import OpenAI from 'react-native-openai';
const openAI = new OpenAI({
apiKey: 'YOUR_API_KEY',
organization: 'YOUR_ORGANIZATION',
});
// Alternatively (recommended), you can use your own backend and not hardcode an API key in your app i.e. https://my-custom-domain.com/v1/chat/completions (follow the same API as OpenAI until pathPrefix is fixed on Android)
const openAI = new OpenAI({
host: 'my-custom-host.com',
});
const [result, setResult] = React.useState('');
// Listen for messages
openAI.chat.addListener('onChatMessageReceived', (payload) => {
setResult((message) => {
const newMessage = payload.choices[0]?.delta.content;
if (newMessage) {
return message + newMessage;
}
return message;
});
});
// Send a message
openAI.chat.stream({
messages: [
{
role: 'user',
content: 'How do I star a repo?',
},
],
model: 'gpt-3.5-turbo',
});
// Alternatively, you can use the create method if `stream` is false
await openAI.chat.create(...)
const result = await openAI.image.create({
prompt: 'An awesome Candle logo',
n: 3,
size: '512x512',
});
setImages(result.data.map((image) => image.url));
Thank you to Dylan Shine & Mouaad Aallam for making openai-kit and openai-kotlin which this library is based on.
MIT
FAQs
OpenAI API for React Native
We found that react-native-openai demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.