Add Openai Streaming Rn logo

Add Openai Streaming Rn

Community
khadinakbarlabs
add-openai-streaming-rn

Add authenticated, rate-limited AI streaming to an Expo app without exposing a provider key. Use when the user says 'add openai', 'streaming chat rn', 'gpt in app', 'ai chat ios', or 'openai streaming'.

Overview

Publisherkhadinakbarlabs
Repositoryexpo-mobile-app-builder
Skill nameadd-openai-streaming-rn
Stars
3
Forks
0
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by khadinakbarlabs on GitHub. Read the source before you install it.

Installation

Install the Add Openai Streaming Rn AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/khadinakbarlabs/expo-mobile-app-builder/tree/main/skills/add-openai-streaming-rn
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/khadinakbarlabs/expo-mobile-app-builder.git /tmp/expo-mobile-app-builder
mkdir -p .claude/skills
cp -r /tmp/expo-mobile-app-builder/skills/add-openai-streaming-rn .claude/skills/add-openai-streaming-rn
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Add Openai Streaming Rn in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Add Openai Streaming Rn on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Add Openai Streaming Rn is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Add Secure AI Streaming to React Native + Expo

Never call an AI provider directly from a mobile client. Put the provider key in server-side secret storage and require a verified user identity, bounded input, and a server-side quota before every provider request.

Required controls

  • Use an authenticated backend route. For Supabase Edge Functions, use withSupabase({ auth: 'user' }) and keep verify_jwt enabled for user-facing functions.
  • Do not accept a merely present Authorization header as proof of identity.
  • Keep provider keys in server-side secret storage only. Never use an EXPO_PUBLIC_ variable for a private provider key.
  • Enforce a per-user, server-side rate and spend quota with an atomic datastore operation before calling the provider.
  • Bound message count, message size, allowed roles, and request frequency.
  • Show a provider-specific disclosure and obtain consent before the first transfer of user content.

Implementation context

This is inert example source for the consuming app’s deployed backend, not code executed by the plugin. The backend receives an explicit provider adapter configured by the app owner in that app's server-side secret store. Do not read or reuse the installer’s machine credentials, and do not run this example as a plugin hook or local command. The mobile session token in the client example is the consuming app’s signed-in user session, not an installer token.

Authenticated Supabase Edge Function

The following pattern uses Supabase's authenticated user mode. It intentionally keeps the quota implementation server-side because its schema and atomic operation depend on the application's datastore.

ts
import { withSupabase } from 'npm:@supabase/server';

const MAX_MESSAGES = 20;
const MAX_CHARS_PER_MESSAGE = 8_000;

function isValidMessages(value: unknown): value is Array<{ role: string; content: string }> {
  return Array.isArray(value)
    && value.length > 0
    && value.length <= MAX_MESSAGES
    && value.every((message) =>
      message
      && typeof message.role === 'string'
      && ['system', 'user', 'assistant'].includes(message.role)
      && typeof message.content === 'string'
      && message.content.length > 0
      && message.content.length <= MAX_CHARS_PER_MESSAGE
    );
}

export default {
  fetch: withSupabase({ auth: 'user' }, async (req, ctx) => {
    const userId = ctx.userClaims?.sub;
    if (!userId) return new Response('Unauthorized', { status: 401 });

    const body = await req.json().catch(() => null);
    if (!body || !isValidMessages(body.messages)) {
      return new Response('Invalid request', { status: 400 });
    }

    // Implement this as one atomic server-side datastore operation. It must
    // reserve the user's allowance before any provider request is made.
    const allowed = await enforceUserQuotaAtomically(userId);
    if (!allowed) return new Response('Usage limit reached', { status: 429 });

    // Supply this adapter from the consuming app's backend. It uses only that
    // app's explicit provider configuration; it never inspects local CLI auth.
    const upstream = await streamFromAppProvider({ userId, messages: body.messages });

    if (!upstream.ok || !upstream.body) {
      return new Response('Upstream service unavailable', { status: 502 });
    }

    return new Response(upstream.body, {
      headers: {
        'Content-Type': 'text/event-stream',
        'Cache-Control': 'no-cache',
        'X-Content-Type-Options': 'nosniff',
      },
    });
  }),
};

Before deploying, verify the current authentication configuration in the provider's official documentation. Do not set auth: 'none' or disable JWT verification for a route that spends provider funds or reads user data.

enforceUserQuotaAtomically and streamFromAppProvider are required consuming-app implementations, not supplied runtime functions. The provider adapter must keep the app owner's secret in backend-only storage, restrict the destination to OpenAI's API, enforce a fixed model and output-token limit, use a bounded request timeout, and translate network failures into a generic service error. Do not deploy until both adapters exist and the security tests below pass. The plugin itself requires no provider credential and declares no provider connector.

Client streaming

Call the authenticated function through the user's session-aware client. Do not embed a provider key, server secret, or service-role key in the app.

tsx
const res = await expoFetch('https://your-project.functions.supabase.co/chat', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${session?.access_token ?? ''}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ messages }),
  signal: abortRef.current.signal,
});

Treat an absent session as a local sign-in error before making this request. The backend remains the enforcement point.

Streaming parser notes

  • Use expo/fetch or another SDK-54-compatible streaming client after verifying its current compatibility.
  • Cap response size and handle malformed chunks without treating them as trusted app data.
  • Clear the AbortController in finally, and never log user prompts, credentials, or provider responses unless the product's privacy policy permits it.

Consent and privacy

Before first use, disclose the exact provider, what content leaves the device, why it is processed, and where the user can revoke consent. Do not make promises about a provider's data use unless they match the account's current agreement and published terms.

Security tests

  • A missing, malformed, expired, or arbitrary bearer value receives 401 before the provider request.
  • An overlong or malformed message array receives 400.
  • An exhausted user receives 429 and cannot trigger a provider request.
  • A provider failure returns a generic error and does not reveal a key or upstream body.

Pair with

  • 5-1-2-i-ai-disclosure
  • add-app-attestation
  • add-supabase-auth

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Add Openai Streaming Rn AI skill do?

Add authenticated, rate-limited AI streaming to an Expo app without exposing a provider key. Use when the user says 'add openai', 'streaming chat rn', 'gpt in app', 'ai chat ios', or 'openai streaming'.

Why use Add Openai Streaming Rn on TypingMind?

Because you install it once and use it with any model. Add Openai Streaming Rn is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Add Openai Streaming Rn in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/khadinakbarlabs/expo-mobile-app-builder/tree/main/skills/add-openai-streaming-rn. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Add Openai Streaming Rn?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Add Openai Streaming Rn?

As many as you like. As long as a model supports skills, you can use Add Openai Streaming Rn with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Add Openai Streaming Rn AI skill free?

Yes. It is published on GitHub by khadinakbarlabs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇