Skip to content

growth(day-35): @byok-relay/expo — React Native / Expo hooks, ByokRelayClient, AsyncStorage persistence#71

Open
alokit-bot wants to merge 1 commit into
feat/growth-2026-07-11from
feat/growth-2026-07-12
Open

growth(day-35): @byok-relay/expo — React Native / Expo hooks, ByokRelayClient, AsyncStorage persistence#71
alokit-bot wants to merge 1 commit into
feat/growth-2026-07-11from
feat/growth-2026-07-12

Conversation

@alokit-bot

Copy link
Copy Markdown
Collaborator

Growth Day 35 — @byok-relay/expo

Extends byok-relay to the React Native / Expo mobile ecosystem.

What is in this PR

packages/expo/src/index.js (@byok-relay/expo package):

  • useByokRelay — token registration + key CRUD + logout; persists relay token to AsyncStorage (survives app restarts); Expo SecureStore-compatible via custom storage adapter
  • useChat — stateful non-streaming; openai/anthropic/groq/mistral/openrouter; optimistic rollback on error
  • useStreamingChat — fetch-based SSE with AbortController; stopStreaming() partial-commit; streamingContent live string; no EventSource polyfill (uses RN built-in fetch + ReadableStream)
  • useRelayHealth — polls /health; configurable intervalMs; check(deep?) upstream readiness
  • ByokRelayClient — plain-JS class: register, ensureToken, logout, storeKey, listKeys, deleteKey, rotateKey, relayRequest, chat, streamChat async generator with AbortSignal, health/deep, stats, getModels, deleteAccount
  • createAsyncStorage(asyncStorage?) — storage adapter factory; auto-detects AsyncStorage; in-memory fallback with clear warning

Key differences from @byok-relay/react: AsyncStorage (async, persistent) instead of localStorage; fetch + ReadableStream SSE (Hermes-safe); no window globals.

24 smoke tests passing (node test/hooks.test.js).

packages/expo/README.md: full API docs, Expo quick-start, Settings + Chat screen examples, SecureStore guide, all hooks + ByokRelayClient documented.

llms.txt: React Native / Expo Integration section.

README.md: @byok-relay/expo section after TanStack Start.

metrics/daily.jsonl: 2026-07-12 snapshot (stars=52).

Next for Avi: cd packages/expo && npm publish --access public

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5af7bc13-be04-4ccf-a455-240800b0c0e6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/growth-2026-07-12

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant