
Security News
TC39 Advances Temporal to Stage 4 Alongside Several ECMAScript Proposals
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.
react-native-openai
Advanced tools
Currently, this library only supports the Chat API. We are working on adding support for the other APIs. If you would like to contribute, please join our Discord and ask questions in the #oss channel or create a pull request.
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.
yarn add react-native-openai
stream with your messages to generate a streaming completion.import OpenAI from 'react-native-openai';
// 🚩: Do not hard code your API key in production
const openAI = OpenAI({
apiKey: 'YOUR_API_KEY',
organization: 'YOUR_ORGANIZATION',
// host: 'my-custom-host.com', // Optional: add a custom domain
});
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: question,
},
],
model: 'gpt-3.5-turbo',
});
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
The npm package react-native-openai receives a total of 169 weekly downloads. As such, react-native-openai popularity was classified as not popular.
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.

Security News
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.

Research
/Security News
Since January 31, 2026, we identified at least 72 additional malicious Open VSX extensions, including transitive GlassWorm loader extensions targeting developers.

Research
Six malicious Packagist packages posing as OphimCMS themes contain trojanized jQuery that exfiltrates URLs, injects ads, and loads FUNNULL-linked redirects.