npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ct0dev/mini-app-sdk

v1.0.5

Published

A lightweight React Native SDK for ct0.dev mini-apps

Downloads

15

Readme

🧩 @ct0/mini-app-sdk

A lightweight React Native SDK to simplify building AI-generated mini-apps inside ct0.dev.

Includes:

  • ✅ App & user context (MiniAppProvider)
  • ✅ Flexible CRUD (useCrud) for any collection
  • ✅ Shared vs private access support
  • ✅ Auto caching via AsyncStorage
  • ✅ Extensible structure for future hooks (assets, auth, etc.)

✨ Installation

npm install @ct0/mini-app-sdk
# or
yarn add @ct0/mini-app-sdk

Peer dependencies:

- react
- react-dom
- @react-native-async-storage/async-storage

⚙️ Usage

1. Wrap your mini-app with MiniAppProvider

import { MiniAppProvider } from '@ct0/mini-app-sdk';

export default function App() {
  return (
    <MiniAppProvider
      appId="your-app-id"
      userId="ajay"
      apiBaseUrl="https://api.ct0.in"
      theme="dark"
      language="en"
      onClose={() => console.log('App closed')}
      onError={(err) => console.error(err)}
    >
      <YourMiniApp />
    </MiniAppProvider>
  );
}

2. Use Context Anywhere

import { useMiniAppContext } from '@ct0/mini-app-sdk';

const {
  appId,
  userId,
  apiBaseUrl,
  theme,
  language,
  onClose,
  onError
} = useMiniAppContext();

3. Use CRUD for Collections

import { useCrud } from '@ct0/mini-app-sdk';

const { items, create, update, remove, refresh, loading } = useCrud('todos');

Shared access (e.g. group data)

const { items } = useCrud('expenses', { access: 'shared' });

💾 Caching & Offline Support

  • All useCrud() data is cached in AsyncStorage
  • Auto loaded on mount, then updated in background
  • Automatically updated on create, update, remove

🧱 API Summary

| Feature | Hook | Description | Status | |--------------------|-----------------------|---------------------------------------------------|----------| | ✅ App Context | useMiniAppContext() | Access appId, userId, apiBaseUrl, etc. | ✅ Ready | | ✅ Provider | MiniAppProvider | Wrap your app and pass context | ✅ Ready | | ✅ Collection CRUD | useCrud() | Full CRUD with cache + accessMode | ✅ Ready |


🔮 Planned Additions

| Feature | Hook | Priority | |---------------------|---------------------|-----------| | 📁 Asset Uploads | useAssets() | 🔜 High | | 🧠 Auth | useAuth() | 🔜 High | | 🛠 App Settings | useSettings() | 🔜 Medium | | 🌍 Translations | useI18n() | 🔜 Medium | | 🔔 Notifications | useNotifications() | 🔜 Medium | | 🕸 Realtime Sync | useRealtime() | 🔜 Medium | | 📸 Media Capture | useCamera() | 🔜 Medium | | 📤 Share | useShare() | 🔜 Optional | | 🎛 Experiments | useExperiments() | 🔜 Optional |


✅ 𝙲𝙾𝚁𝙴 𝙰𝙿𝙸 𝙰𝙱𝚂𝚃𝚁𝙰𝙲𝚃𝙸𝙾𝙽𝚂

| Feature | Hook | Description | Priority | |----------------|----------------|-------------------------------------------------------|-----------------| | 🧠 User Auth | useAuth() | Identity context (guest/userId/login/logout) | ✅ Essential | | 📦 CRUD | useCrud() | Generic collection-level CRUD with offline support | ✅ Already Done | | 📁 Asset Uploads | useAssets() | Upload image/audio/video/files and get back URL | ✅ High | | 🔄 Sync + Cache| useSync() | Background syncing, stale/while-revalidate pattern | ✅ High | | 🧾 Metadata | useMeta() | Access appId, collectionId, userId, access mode | ✅ Essential |


🎨 𝚄𝚂𝙴𝚁 𝙴𝚇𝙿𝙴𝚁𝙸𝙴𝙽𝙲𝙴

| Feature | Hook | Description | Priority | |-----------------|---------------------|-----------------------------------------------|----------------| | 📍 Location | useLocation() | Get current location with permission flow | 🔜 Medium | | 📤 Share | useShare() | Native or link-based content sharing | 🔜 Medium | | 🔔 Notifications| useNotifications() | Show toast/in-app/push alerts | 🔜 Medium | | 🌓 Theme | useTheme() | Access color palette, dark/light, etc. | 🔜 Optional | | 🌐 Language | useI18n() | Simple string translation + language switch | 🔜 Optional |


🧰 𝙲𝙾𝙼𝙿𝙾𝙽𝙴𝙽𝚃 + 𝚂𝚃𝙰𝚃𝙴 𝚄𝚃𝙸𝙻𝚂

| Feature | Hook | Description | Priority | |-----------------|-------------------|-----------------------------------------------------|----------------| | 💾 Local Storage| useStorage() | Persistent key-value store (per user/app) | ✅ High | | 🧪 Experiments | useExperiments() | Feature flags + variant checks | 🔜 Optional | | ⚙️ Settings | useSettings() | App-wide settings (e.g. preferences) | 🔜 Optional | | 🧭 Navigation | useNav() | Abstracted navigation across host/mini | 🔜 TBD | | 💬 Prompting | usePrompt() | Call AI (Together, OpenAI, etc.) from inside app | 🔜 Very Useful |


🔁 𝚁𝙴𝙰𝙻𝚃𝙸𝙼𝙴 + 𝙲𝙾𝙻𝙻𝙰𝙱

| Feature | Hook | Description | Priority | |-----------------|-------------------|-----------------------------------------------------|----------------| | 🔃 Realtime Data| useRealtime() | Pub-sub or listener on collection | 🔜 Medium | | 👥 Presence | usePresence() | Track who is online or live | 🔜 Optional | | 🕒 Scheduler | useScheduler() | Run tasks on interval (e.g., sync every 5m) | 🔜 Optional | | ⌛ Offline Detector | useOffline() | Show fallback if no connection | 🔜 Optional |


🧩 𝚂𝙿𝙴𝙲𝙸𝙰𝙻 𝙼𝙾𝙳𝙴𝙻𝚂 / 𝙲𝙰𝚂𝙴𝚂

| Feature | Hook | Description | Priority | |-----------------|-----------------------|--------------------------------------------------|----------------| | 📸 Media Capture| useCamera() / useMicrophone() | Capture image/audio and upload | ✅ For image/audio blogs | | 📚 Collections Index | useIndex() | List all collections + schemas in app | 🔜 Optional | | 🧵 Comments | useComments() | Prebuilt support for threaded replies | 🔜 Optional | | 📈 Metrics | useMetrics() | Record engagement, actions, views | 🔜 Optional | | 🎁 Templates | useTemplates() | Fetch reusable templates/layouts | 🔜 Optional |


📋 𝙿𝙻𝙰𝚃𝙵𝙾𝚁𝙼 𝚂𝚄𝙿𝙿𝙾𝚁𝚃

| Feature | Hook | Description | Priority | |-----------------|-------------------|-------------------------------------------------|-----------------| | 🧠 Model Context| useModelInfo() | Detect which model generated this mini-app | 🔜 Debugging | | 🧩 App Info | useAppInfo() | Show version, bundle source, build ID | 🔜 Optional | | 🧹 Cache Management | useCache() | Clear app or component cache | ✅ Already Added |


🧪 EXAMPLE ROLLING PLAN

  • useCrud(), useAssets(), useAuth()
  • useMeta(), useStorage()
  • 🔜 useNotifications(), useLocation(), usePrompt()
  • 🔜 useRealtime(), useShare(), useCamera()
  • 🔜 Advanced: useExperiments(), useScheduler(), usePresence()

🧪 Dev Commands

yarn build       # Compile SDK to dist/
yarn dev         # Watch mode (Rollup)
yarn lint        # ESLint
yarn format      # Prettier

📦 This SDK powers…

✅ Todo apps
✅ Expense splitters
✅ Journals, trackers, diaries
✅ Group shared utilities
…and 100s of AI-generated ct0.dev apps!


Made for dynamic creativity at ct0.dev