vybekiit 0.7.29 → 0.7.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +3407 -2769
- package/dist/global-guidance/language.md +7 -102
- package/dist/global-skills/add-ai/SKILL.md +7 -8
- package/dist/global-skills/add-analytics/SKILL.md +4 -7
- package/dist/global-skills/add-app-clip/SKILL.md +1 -0
- package/dist/global-skills/add-blog/SKILL.md +4 -7
- package/dist/global-skills/add-files/SKILL.md +4 -7
- package/dist/global-skills/add-images/SKILL.md +4 -7
- package/dist/global-skills/add-language/SKILL.md +5 -8
- package/dist/global-skills/add-notifications/SKILL.md +4 -7
- package/dist/global-skills/add-realtime/SKILL.md +4 -7
- package/dist/global-skills/add-search/SKILL.md +4 -7
- package/dist/global-skills/add-signin/SKILL.md +4 -8
- package/dist/global-skills/add-teams/SKILL.md +4 -7
- package/dist/global-skills/aws-cdk/SKILL.md +1 -0
- package/dist/global-skills/aws-cloudformation/SKILL.md +1 -0
- package/dist/global-skills/aws-serverless/SKILL.md +169 -32
- package/dist/global-skills/aws-serverless/references/api-gateway.md +17 -0
- package/dist/global-skills/aws-serverless/references/architecture.md +9 -13
- package/dist/global-skills/aws-serverless/references/compute-decision-edge-cases.md +77 -0
- package/dist/global-skills/aws-serverless/references/lambda.md +3 -3
- package/dist/global-skills/aws-serverless/references/orchestration.md +46 -20
- package/dist/global-skills/aws-serverless/references/production.md +1 -1
- package/dist/global-skills/better-auth-best-practices/SKILL.md +1 -0
- package/dist/global-skills/better-auth-security-best-practices/SKILL.md +1 -0
- package/dist/global-skills/building-native-ui/SKILL.md +1 -0
- package/dist/global-skills/buy-domain/SKILL.md +4 -7
- package/dist/global-skills/check-safety/SKILL.md +5 -8
- package/dist/global-skills/claimable-postgres/SKILL.md +1 -0
- package/dist/global-skills/configure-capabilities/SKILL.md +1 -1
- package/dist/global-skills/connect-account/SKILL.md +1 -1
- package/dist/global-skills/create-auth-skill/SKILL.md +1 -0
- package/dist/global-skills/doctor/SKILL.md +1 -1
- package/dist/global-skills/eas-app-stores/SKILL.md +2 -1
- package/dist/global-skills/eas-app-stores/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-hosting/SKILL.md +2 -1
- package/dist/global-skills/eas-hosting/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-observe/SKILL.md +2 -1
- package/dist/global-skills/eas-observe/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-simulator/SKILL.md +24 -16
- package/dist/global-skills/eas-simulator/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-simulator/references/controllers.md +11 -7
- package/dist/global-skills/eas-simulator/references/logs-and-crashes.md +101 -0
- package/dist/global-skills/eas-simulator/references/run-your-app.md +8 -8
- package/dist/global-skills/eas-simulator/references/troubleshooting.md +14 -6
- package/dist/global-skills/eas-update/SKILL.md +2 -1
- package/dist/global-skills/eas-update/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-update-insights/SKILL.md +2 -1
- package/dist/global-skills/eas-update-insights/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-workflows/SKILL.md +2 -1
- package/dist/global-skills/eas-workflows/agents/openai.yaml +1 -1
- package/dist/global-skills/email-best-practices/SKILL.md +1 -0
- package/dist/global-skills/email-best-practices/references/sending-reliability.md +17 -22
- package/dist/global-skills/expo-animation/SKILL.md +2 -1
- package/dist/global-skills/expo-api-routes/SKILL.md +1 -0
- package/dist/global-skills/expo-app-clip/SKILL.md +2 -1
- package/dist/global-skills/expo-brownfield/SKILL.md +2 -1
- package/dist/global-skills/expo-cicd-workflows/SKILL.md +1 -0
- package/dist/global-skills/expo-data-fetching/SKILL.md +2 -1
- package/dist/global-skills/expo-deployment/SKILL.md +1 -0
- package/dist/global-skills/expo-design-system/SKILL.md +2 -1
- package/dist/global-skills/expo-dev-client/SKILL.md +2 -1
- package/dist/global-skills/expo-dom/SKILL.md +2 -1
- package/dist/global-skills/expo-examples/SKILL.md +2 -1
- package/dist/global-skills/expo-migrate-module/SKILL.md +2 -1
- package/dist/global-skills/expo-module/SKILL.md +2 -1
- package/dist/global-skills/expo-native-ui/SKILL.md +2 -1
- package/dist/global-skills/expo-observe/SKILL.md +1 -0
- package/dist/global-skills/expo-overview/SKILL.md +2 -1
- package/dist/global-skills/expo-project-structure/SKILL.md +2 -1
- package/dist/global-skills/expo-router/SKILL.md +2 -1
- package/dist/global-skills/expo-skill-eval/SKILL.md +1 -0
- package/dist/global-skills/expo-skill-feedback/SKILL.md +1 -0
- package/dist/global-skills/expo-tailwind-setup/SKILL.md +1 -0
- package/dist/global-skills/expo-ui/SKILL.md +2 -1
- package/dist/global-skills/expo-upgrade/SKILL.md +2 -1
- package/dist/global-skills/expo-web-to-native/SKILL.md +2 -1
- package/dist/global-skills/extension-to-functions-codebase/SKILL.md +2 -0
- package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +162 -76
- package/dist/global-skills/firebase-ai-logic-basics/references/flutter_setup.md +37 -0
- package/dist/global-skills/firebase-ai-logic-basics/references/ios_setup.md +97 -3
- package/dist/global-skills/firebase-ai-logic-basics/references/tts_generation.md +676 -0
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_android.md +88 -3
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_web.md +91 -3
- package/dist/global-skills/firebase-app-hosting-basics/SKILL.md +6 -1
- package/dist/global-skills/firebase-auth-basics/SKILL.md +12 -6
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_android.md +61 -23
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_web.md +3 -3
- package/dist/global-skills/firebase-auth-basics/references/flutter_setup.md +22 -19
- package/dist/global-skills/firebase-auth-basics/references/security_rules.md +2 -2
- package/dist/global-skills/firebase-basics/SKILL.md +8 -2
- package/dist/global-skills/firebase-basics/references/android_setup.md +229 -23
- package/dist/global-skills/firebase-basics/references/ios_setup.md +57 -0
- package/dist/global-skills/firebase-basics/references/web_setup.md +52 -0
- package/dist/global-skills/firebase-crashlytics/SKILL.md +2 -0
- package/dist/global-skills/firebase-crashlytics/references/android_setup.md +99 -71
- package/dist/global-skills/firebase-crashlytics/references/ios_setup.md +1 -0
- package/dist/global-skills/firebase-data-connect/SKILL.md +2 -0
- package/dist/global-skills/firebase-data-connect/reference/config.md +8 -8
- package/dist/global-skills/firebase-data-connect/reference/realtime.md +4 -1
- package/dist/global-skills/firebase-data-connect/reference/sdk_android.md +84 -29
- package/dist/global-skills/firebase-data-connect/reference/sdk_web.md +8 -3
- package/dist/global-skills/firebase-data-connect/reference/security.md +13 -13
- package/dist/global-skills/firebase-firestore/SKILL.md +18 -7
- package/dist/global-skills/firebase-firestore/references/enterprise/android_sdk_usage.md +47 -21
- package/dist/global-skills/firebase-firestore/references/enterprise/indexes.md +2 -1
- package/dist/global-skills/firebase-firestore/references/standard/android_sdk_usage.md +63 -27
- package/dist/global-skills/firebase-firestore/references/standard/indexes.md +2 -1
- package/dist/global-skills/firebase-hosting-basics/SKILL.md +2 -0
- package/dist/global-skills/firebase-remote-config-basics/SKILL.md +3 -1
- package/dist/global-skills/firebase-remote-config-basics/references/android_setup.md +83 -92
- package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +8 -6
- package/dist/global-skills/firestore-rules-creation/SKILL.md +23 -10
- package/dist/global-skills/go-live/SKILL.md +7 -7
- package/dist/global-skills/harden/SKILL.md +7 -10
- package/dist/global-skills/instrument-feature-flags/SKILL.md +1 -0
- package/dist/global-skills/instrument-product-analytics/SKILL.md +1 -0
- package/dist/global-skills/manifest.json +2 -1
- package/dist/global-skills/mongodb-atlas-stream-processing/SKILL.md +1 -0
- package/dist/global-skills/mongodb-connection/SKILL.md +1 -0
- package/dist/global-skills/mongodb-mcp-setup/SKILL.md +1 -0
- package/dist/global-skills/mongodb-natural-language-querying/SKILL.md +1 -0
- package/dist/global-skills/mongodb-qe-size-estimation/SKILL.md +224 -0
- package/dist/global-skills/mongodb-query-optimizer/SKILL.md +1 -0
- package/dist/global-skills/mongodb-schema-design/SKILL.md +1 -0
- package/dist/global-skills/mongodb-search-and-ai/SKILL.md +1 -0
- package/dist/global-skills/native-data-fetching/SKILL.md +1 -0
- package/dist/global-skills/neon/SKILL.md +34 -5
- package/dist/global-skills/neon-ai-gateway/SKILL.md +44 -14
- package/dist/global-skills/neon-auth/SKILL.md +1 -0
- package/dist/global-skills/neon-functions/SKILL.md +12 -0
- package/dist/global-skills/neon-functions/references/native-binaries.md +188 -0
- package/dist/global-skills/neon-object-storage/SKILL.md +1 -0
- package/dist/global-skills/neon-postgres/SKILL.md +2 -1
- package/dist/global-skills/neon-postgres/references/full-text-search.md +27 -17
- package/dist/global-skills/neon-postgres/references/hybrid-search.md +19 -15
- package/dist/global-skills/neon-postgres/references/lakebase-search-drizzle.md +99 -14
- package/dist/global-skills/neon-postgres/references/vector-search.md +93 -10
- package/dist/global-skills/neon-postgres-branches/SKILL.md +1 -0
- package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +1 -0
- package/dist/global-skills/onboarding/SKILL.md +14 -13
- package/dist/global-skills/plan-my-idea/SKILL.md +1 -1
- package/dist/global-skills/publish-app/SKILL.md +1 -1
- package/dist/global-skills/publish-extension/SKILL.md +1 -1
- package/dist/global-skills/resend/SKILL.md +5 -15
- package/dist/global-skills/resend/references/domains.md +1 -1
- package/dist/global-skills/resend/references/installation.md +3 -3
- package/dist/global-skills/resend/references/sending/best-practices.md +3 -3
- package/dist/global-skills/resend/references/sending/single-email-examples.md +3 -3
- package/dist/global-skills/resend/references/webhooks.md +2 -0
- package/dist/global-skills/reset-password/SKILL.md +4 -6
- package/dist/global-skills/save-data/SKILL.md +3 -0
- package/dist/global-skills/sentry-sdk-setup/SKILL.md +1 -0
- package/dist/global-skills/sentry-workflow/SKILL.md +1 -0
- package/dist/global-skills/setup-email/SKILL.md +7 -8
- package/dist/global-skills/setup-payments/SKILL.md +10 -12
- package/dist/global-skills/setup-sms/SKILL.md +1 -1
- package/dist/global-skills/sign-in-with-email-link/SKILL.md +4 -6
- package/dist/global-skills/sign-in-with-google/SKILL.md +14 -13
- package/dist/global-skills/sign-in-with-phone/SKILL.md +5 -7
- package/dist/global-skills/stripe-best-practices/SKILL.md +20 -19
- package/dist/global-skills/stripe-best-practices/references/billing.md +2 -0
- package/dist/global-skills/stripe-best-practices/references/payments.md +1 -1
- package/dist/global-skills/stripe-best-practices/references/tax.md +27 -15
- package/dist/global-skills/supabase/CHANGELOG.md +19 -0
- package/dist/global-skills/supabase/SKILL.md +1 -0
- package/dist/global-skills/supabase-postgres-best-practices/SKILL.md +1 -0
- package/dist/global-skills/track-errors/SKILL.md +12 -13
- package/dist/global-skills/update-kit/SKILL.md +1 -1
- package/dist/global-skills/upgrading-expo/SKILL.md +1 -0
- package/dist/global-skills/use-dom/SKILL.md +1 -0
- package/dist/global-skills/use-railway/SKILL.md +9 -8
- package/dist/global-skills/use-railway/references/configure.md +34 -1
- package/dist/global-skills/use-railway/references/iac.md +3 -0
- package/dist/global-skills/use-railway/references/tracing.md +97 -44
- package/dist/global-skills/vercel-composition-patterns/SKILL.md +1 -0
- package/dist/global-skills/vercel-react-best-practices/SKILL.md +1 -0
- package/dist/global-skills/vybekiitReferences/backend/AGENTS.md +11 -3
- package/dist/global-skills/vybekiitReferences/backend/agent/goal-index.md +1 -1
- package/dist/global-skills/vybekiitReferences/backend/agent/goal-routes.json +229 -0
- package/dist/global-skills/vybekiitReferences/backend/agent/mcp-setup.md +11 -2
- package/dist/global-skills/vybekiitReferences/backend/agent/session-bootstrap.md +1 -1
- package/dist/global-skills/vybekiitReferences/backend/agent/tech-references.md +1 -1
- package/dist/global-skills/vybekiitReferences/backend/language.md +7 -102
- package/dist/global-skills/vybekiitReferences/backend/platform-skills/deploy-railway-vybekiit.md +2 -2
- package/dist/global-skills/vybekiitReferences/backend/platform-skills/extend-capabilities-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/backend/platform-skills/mongodb-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/extension/AGENTS.md +11 -3
- package/dist/global-skills/vybekiitReferences/extension/agent/goal-index.md +1 -1
- package/dist/global-skills/vybekiitReferences/extension/agent/goal-routes.json +239 -0
- package/dist/global-skills/vybekiitReferences/extension/agent/mcp-setup.md +10 -1
- package/dist/global-skills/vybekiitReferences/extension/agent/session-bootstrap.md +1 -1
- package/dist/global-skills/vybekiitReferences/extension/agent/tech-references.md +1 -1
- package/dist/global-skills/vybekiitReferences/extension/agent/ui-sources.md +11 -8
- package/dist/global-skills/vybekiitReferences/extension/language.md +7 -92
- package/dist/global-skills/vybekiitReferences/extension/platform-skills/browser-automation-vybekiit.md +9 -1
- package/dist/global-skills/vybekiitReferences/extension/platform-skills/env-secrets-vybekiit.md +1 -0
- package/dist/global-skills/vybekiitReferences/extension/platform-skills/extend-capabilities-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/extension/platform-skills/observability-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/extension/platform-skills/sentry-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/AGENTS.md +27 -12
- package/dist/global-skills/vybekiitReferences/mobile/agent/goal-index.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/agent/goal-routes.json +279 -0
- package/dist/global-skills/vybekiitReferences/mobile/agent/mcp-setup.md +10 -1
- package/dist/global-skills/vybekiitReferences/mobile/agent/session-bootstrap.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/agent/tech-references.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/agent/ui-sources.mobile.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/language.md +7 -93
- package/dist/global-skills/vybekiitReferences/mobile/platform-skills/env-secrets-vybekiit.md +1 -0
- package/dist/global-skills/vybekiitReferences/mobile/platform-skills/extend-capabilities-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/platform-skills/i18n-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/platform-skills/observability-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/platform-skills/sentry-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/platform-skills/ui-port-from-web-vybekiit.md +2 -2
- package/dist/global-skills/vybekiitReferences/spa/AGENTS.md +11 -3
- package/dist/global-skills/vybekiitReferences/spa/agent/goal-index.md +1 -1
- package/dist/global-skills/vybekiitReferences/spa/agent/goal-routes.json +267 -0
- package/dist/global-skills/vybekiitReferences/spa/agent/mcp-setup.md +10 -1
- package/dist/global-skills/vybekiitReferences/spa/agent/session-bootstrap.md +1 -1
- package/dist/global-skills/vybekiitReferences/spa/agent/ui-sources.md +11 -8
- package/dist/global-skills/vybekiitReferences/spa/language.md +7 -11
- package/dist/global-skills/vybekiitReferences/web/AGENTS.md +15 -30
- package/dist/global-skills/vybekiitReferences/web/agent/goal-index.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/agent/goal-routes.json +366 -0
- package/dist/global-skills/vybekiitReferences/web/agent/mcp-setup.md +11 -2
- package/dist/global-skills/vybekiitReferences/web/agent/session-bootstrap.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/language.md +7 -102
- package/dist/global-skills/vybekiitReferences/web/platform-skills/ai-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/analytics-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/assets-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/better-auth-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/browser-automation-vybekiit.md +9 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/cms-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/compliance-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/deploy-github-pages-vybekiit.md +2 -2
- package/dist/global-skills/vybekiitReferences/web/platform-skills/deploy-railway-vybekiit.md +2 -2
- package/dist/global-skills/vybekiitReferences/web/platform-skills/deploy-vercel-vybekiit.md +2 -2
- package/dist/global-skills/vybekiitReferences/web/platform-skills/env-secrets-vybekiit.md +1 -0
- package/dist/global-skills/vybekiitReferences/web/platform-skills/extend-capabilities-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/i18n-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/jobs-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/kv-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/lemon-squeezy-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/mongodb-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/notifications-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/observability-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/paypal-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/realtime-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/registrar-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/search-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/sentry-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/seo-vybekiit.md +1 -3
- package/dist/global-skills/vybekiitReferences/web/platform-skills/supabase-vybekiit.md +1 -1
- package/dist/global-skills/vybekiitReferences/web/platform-skills/tenancy-vybekiit.md +1 -1
- package/dist/global-skills/web-to-native/SKILL.md +1 -0
- package/dist/global-skills/workers-best-practices/SKILL.md +5 -4
- package/dist/global-skills/workers-best-practices/references/configuration.md +1 -1
- package/dist/global-skills/workers-best-practices/references/platform-apis.md +5 -5
- package/dist/global-skills/workers-best-practices/references/runtime-patterns.md +1 -1
- package/dist/global-skills/wrangler/SKILL.md +28 -25
- package/dist/global-skills/xcode-project-setup/SKILL.md +2 -0
- package/package.json +10 -8
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: expo-skill-feedback
|
|
3
3
|
description: 'Submit feedback on an Expo skill—or Expo itself—and control bundled anonymous usage telemetry (off by default / opt-in). Submit feedback with: npx --yes submit-expo-feedback@latest "ACTIONABLE_FEEDBACK". Optionally add either or both: --category "CATEGORY" and --subject "SUBJECT". Replace the uppercase placeholders before running. Use when a skill was useful, confusing, broken, missing context, or worth improving; when Expo, Expo CLI, EAS CLI, docs, or MCP worked well or fell short; when an AI agent repeatedly failed, got stuck, or needed the user to take over an Expo task (report it as an eval candidate); or when the user explicitly asks to enable or disable telemetry (tracking), check its status, or understand what it collects.'
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Expo Skill Feedback
|
|
@@ -3,6 +3,7 @@ name: expo-tailwind-setup
|
|
|
3
3
|
description: Framework (OSS). Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
license: MIT
|
|
6
|
+
disable-model-invocation: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Tailwind CSS Setup for Expo with react-native-css
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: expo-ui
|
|
3
|
-
description: "
|
|
3
|
+
description: "Build native UI with the @expo/ui package: real SwiftUI on iOS and Jetpack Compose on Android. Default to @expo/ui for sheets (BottomSheet), pickers, sliders, toggles, menus, and grouped-form sections — do NOT reach for Reanimated, @gorhom/bottom-sheet, or RN built-in Picker/Switch; use @expo/ui instead. Fall back to RN built-ins only when @expo/ui is missing the component. NOTE: @expo/ui List renders native grouped rows like an iOS Settings screen — it is NOT a virtualized list; use FlatList/FlashList for large datasets. Covers universal components (Host, Column, Row, Button, Text, List, BottomSheet, FieldGroup, Switch, Slider, Picker, Menu), drop-in replacements for RN community libraries, and platform-specific SwiftUI/Jetpack Compose trees. Not for Expo Router navigation, Reanimated, or data fetching."
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
license: MIT
|
|
6
6
|
allowed-tools: "Bash(node *expo-ui/scripts/list-components.js *)"
|
|
7
|
+
disable-model-invocation: true
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Expo UI (`@expo/ui`)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: expo-upgrade
|
|
3
|
-
description:
|
|
3
|
+
description: Guidelines for upgrading Expo SDK versions and fixing dependency issues
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
license: MIT
|
|
6
|
+
disable-model-invocation: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
## References
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: expo-web-to-native
|
|
3
|
-
description:
|
|
3
|
+
description: Migrate an existing web React app to a native iOS/Android app with Expo. Use when the user wants to turn a website into a mobile app, port a Next.js/Vite/CRA React codebase to React Native, reuse web code on native incrementally, or asks how web idioms (the DOM, CSS, React Router, localStorage, window) map to native. This is the end-to-end migration guide; use the `expo-dom` skill for the DOM-component mechanism itself.
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
license: MIT
|
|
6
|
+
disable-model-invocation: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Web to Native
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
name: extension-to-functions-codebase
|
|
3
3
|
description: Skill for converting an installed Firebase Extension (or extension source) into a standalone Cloud Functions for Firebase codebase or publishable npm package, including V1 to V2 trigger upgrades, lifecycle hooks, and declarative security
|
|
4
4
|
metadata:
|
|
5
|
+
author: Google LLC
|
|
5
6
|
category: Serverless
|
|
7
|
+
disable-model-invocation: true
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
# Extension to Functions Codebase & npm Package Migration
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: firebase-ai-logic-basics
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.
|
|
4
5
|
version: 1.0.1
|
|
5
6
|
metadata:
|
|
7
|
+
author: Google LLC
|
|
6
8
|
category: AiAndMachineLearning
|
|
9
|
+
disable-model-invocation: true
|
|
7
10
|
---
|
|
8
11
|
|
|
9
12
|
# Firebase AI Logic Basics
|
|
@@ -11,57 +14,98 @@ metadata:
|
|
|
11
14
|
## Overview
|
|
12
15
|
|
|
13
16
|
Firebase AI Logic is a product of Firebase that allows developers to add gen AI
|
|
14
|
-
to their mobile and web apps using client-side SDKs.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
to their mobile and web apps using client-side SDKs. The app can directly call
|
|
18
|
+
Gemini models via Firebase AI Logic without the developer needing to manage a
|
|
19
|
+
dedicated backend. Firebase AI Logic was previously known as "Vertex AI for
|
|
20
|
+
Firebase".
|
|
18
21
|
|
|
19
22
|
It supports the two Gemini API providers:
|
|
20
23
|
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
24
|
+
- **Gemini Developer API**: It has a free tier ideal for prototyping, and
|
|
25
|
+
pay-as-you-go for production
|
|
26
|
+
- **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale
|
|
27
|
+
with enterprise-grade production readiness, requires Blaze pricing plan
|
|
25
28
|
|
|
26
29
|
Use the Gemini Developer API as a default, and only Agent Platform Gemini API
|
|
27
30
|
(formerly branded Vertex AI) if the application requires it.
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
______________________________________________________________________
|
|
33
|
+
|
|
34
|
+
## Setup & initialization
|
|
30
35
|
|
|
31
36
|
### Prerequisites
|
|
32
37
|
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
- Identify the platform the user is interested in building on prior to starting:
|
|
39
|
+
Android, iOS, Web, or Flutter.
|
|
40
|
+
- If their platform is unsupported, Direct the user to Firebase Docs to learn
|
|
41
|
+
how to set up AI Logic for their application (share this link with the user
|
|
42
|
+
https://firebase.google.com/docs/ai-logic/get-started)
|
|
43
|
+
- The Firebase CLI commands below run through `npx` on every platform, so they
|
|
44
|
+
need **Node.js 20+** and npm. Use the `firebase-basics` skill to check for
|
|
45
|
+
them and to log in to the Firebase CLI. If Node.js is missing or older than
|
|
46
|
+
version 20, ask the user to install it as that skill describes. Don't install
|
|
47
|
+
system packages yourself, for example with `sudo apt-get`, because that
|
|
48
|
+
changes the user's machine without their consent.
|
|
49
|
+
|
|
50
|
+
### 1. Provision Firebase AI Logic (ALL platforms)
|
|
51
|
+
|
|
52
|
+
Use the **Firebase CLI** to provision Firebase AI Logic for the Firebase
|
|
53
|
+
Project:
|
|
54
|
+
|
|
55
|
+
1. Make sure that you're in a firebase directory (with a `firebase.json`).
|
|
40
56
|
|
|
41
|
-
|
|
57
|
+
1. Verify that you're running Firebase CLI commands against the intended
|
|
58
|
+
Firebase Project. When you run this command, the active project is marked
|
|
59
|
+
with "current":
|
|
42
60
|
|
|
43
|
-
|
|
61
|
+
```bash
|
|
62
|
+
npx -y firebase-tools@latest projects:list
|
|
63
|
+
```
|
|
44
64
|
|
|
45
|
-
|
|
65
|
+
1. Make sure there's at least one Firebase App for the target platform
|
|
66
|
+
registered with the current Firebase Project:
|
|
46
67
|
|
|
47
|
-
|
|
48
|
-
|
|
68
|
+
```bash
|
|
69
|
+
npx -y firebase-tools@latest apps:list
|
|
70
|
+
```
|
|
49
71
|
|
|
50
|
-
|
|
72
|
+
1. Provision Firebase AI Logic for the Firebase Project:
|
|
51
73
|
|
|
52
|
-
|
|
74
|
+
```bash
|
|
75
|
+
npx -y firebase-tools@latest init ailogic
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This command will enable the Gemini Developer API in the Firebase project.
|
|
79
|
+
|
|
80
|
+
> [!WARNING] **CRITICAL: Provisioning Firebase AI Logic is Required** For all
|
|
81
|
+
> platforms (Android, iOS, Web, or Flutter), even if the app already uses
|
|
82
|
+
> Firebase, you MUST run `npx -y firebase-tools@latest init ailogic` to
|
|
83
|
+
> provision the service. The configuration files of `GoogleService-Info.plist`,
|
|
84
|
+
> `google-services.json`, and `firebase_options.dart` ONLY handle client
|
|
85
|
+
> configuration and do NOT enable the Firebase AI Logic service, leading to
|
|
86
|
+
> `PERMISSION_DENIED` errors.
|
|
53
87
|
|
|
54
|
-
`
|
|
88
|
+
If you can't run `init ailogic` yourself (for example because Node.js is missing
|
|
89
|
+
or the Firebase CLI isn't logged in) do NOT skip it. The app's requests to
|
|
90
|
+
Gemini models will fail until the Firebase AI Logic service is provisioned. Tell
|
|
91
|
+
the user to run this command in their project directory, and include it in your
|
|
92
|
+
final summary:
|
|
55
93
|
|
|
56
|
-
|
|
94
|
+
```bash
|
|
95
|
+
npx -y firebase-tools@latest init ailogic
|
|
96
|
+
```
|
|
57
97
|
|
|
58
|
-
|
|
98
|
+
### 2. Add the SDK and initialize the service in the app
|
|
59
99
|
|
|
60
|
-
|
|
100
|
+
Adding the SDK dependency and initializing the service are platform-specific.
|
|
101
|
+
Before writing code, read the reference for the target platform listed under
|
|
102
|
+
[Initialization Code References](#initialization-code-references).
|
|
61
103
|
|
|
62
104
|
More info in
|
|
63
105
|
[Firebase AI Logic Getting Started](https://firebase.google.com/docs/ai-logic/get-started.md.txt)
|
|
64
106
|
|
|
107
|
+
______________________________________________________________________
|
|
108
|
+
|
|
65
109
|
## Core Capabilities
|
|
66
110
|
|
|
67
111
|
> [!WARNING] **CRITICAL: Use current model names:** Always check the
|
|
@@ -91,16 +135,42 @@ To improve the user experience by showing partial results as they arrive (like a
|
|
|
91
135
|
typing effect), use `generateContentStream` instead of `generateContent` for
|
|
92
136
|
faster display of results.
|
|
93
137
|
|
|
138
|
+
### Text-to-Speech (TTS) Generation
|
|
139
|
+
|
|
140
|
+
Generate spoken audio directly on client devices without a custom speech
|
|
141
|
+
backend. Firebase AI Logic supports speech synthesis using dedicated Gemini TTS
|
|
142
|
+
models:
|
|
143
|
+
|
|
144
|
+
- **Supported Models**: `gemini-3.1-flash-tts-preview`
|
|
145
|
+
- **Capabilities**:
|
|
146
|
+
- Single-speaker voice persona selection (`voiceName`) and multi-speaker
|
|
147
|
+
dialogues (up to 2 distinct speakers) via `SpeechConfig` /
|
|
148
|
+
`MultiSpeakerVoiceConfig`
|
|
149
|
+
- Direct audio responses by setting `responseModalities` to audio
|
|
150
|
+
- Streaming speech responses with `generateContentStream` for low-latency
|
|
151
|
+
playback
|
|
152
|
+
- Audio directives (`[Audio Profile: ...]`, `[Scene: ...]`,
|
|
153
|
+
`[Director's Note: ...]`) and emotional tags (`[whispers]`, `[laughs]`,
|
|
154
|
+
`[slowly]`)
|
|
155
|
+
- Client-side decoding and playback of 24 kHz 16-bit linear PCM (`audio/l16`)
|
|
156
|
+
or WAV container format (`audio/x-wav`)
|
|
157
|
+
|
|
158
|
+
See the [Text-to-Speech (TTS) Generation Guide](references/tts_generation.md)
|
|
159
|
+
for full implementation details, streaming patterns, and copy-paste code
|
|
160
|
+
snippets for iOS (Swift), Android (Kotlin), and Web.
|
|
161
|
+
|
|
94
162
|
### Generate Images with Nano Banana
|
|
95
163
|
|
|
96
164
|
> [!WARNING] **Use current Image model names:** Always check the
|
|
97
165
|
> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)
|
|
98
166
|
> for the currently supported image generation (Nano Banana) model names.
|
|
99
167
|
|
|
100
|
-
-
|
|
168
|
+
- Requires an upgraded Blaze pay-as-you-go billing plan.
|
|
101
169
|
|
|
102
170
|
### Search Grounding with the built in googleSearch tool
|
|
103
171
|
|
|
172
|
+
______________________________________________________________________
|
|
173
|
+
|
|
104
174
|
## Supported Platforms and Frameworks
|
|
105
175
|
|
|
106
176
|
Supported Platforms and Frameworks include Kotlin and Java for Android, Swift
|
|
@@ -114,23 +184,26 @@ Enforce a specific JSON schema for the response.
|
|
|
114
184
|
|
|
115
185
|
### On-Device AI (Hybrid)
|
|
116
186
|
|
|
117
|
-
Hybrid on-device
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
187
|
+
Hybrid inference runs prompts with an on-device model when one is available and
|
|
188
|
+
falls back to a cloud-hosted model otherwise (or vice versa). Availability and
|
|
189
|
+
setup steps differ by platform, more info in the
|
|
190
|
+
[hybrid and on-device documentation](https://firebase.google.com/docs/ai-logic/hybrid.md.txt),
|
|
191
|
+
which links to each platform's guide.
|
|
192
|
+
|
|
193
|
+
______________________________________________________________________
|
|
122
194
|
|
|
123
195
|
## Security & Production
|
|
124
196
|
|
|
125
|
-
### App Check
|
|
197
|
+
### Firebase App Check
|
|
126
198
|
|
|
127
199
|
> [!WARNING] **Critical Safety Requirement:** In order to use AI Logic safely,
|
|
128
200
|
> you MUST set up App Check on your app. This prevents unauthorized clients from
|
|
129
201
|
> using your API quota and accessing your backend resources.
|
|
130
202
|
|
|
131
203
|
See
|
|
132
|
-
[App Check
|
|
133
|
-
for setup instructions.
|
|
204
|
+
[App Check for Firebase AI Logic](https://firebase.google.com/docs/ai-logic/app-check.md.txt)
|
|
205
|
+
for setup instructions. Each platform uses its own attestation provider, so
|
|
206
|
+
follow the instructions for the target platform.
|
|
134
207
|
|
|
135
208
|
#### App Check Debug Tokens for Local Development & CI/CD
|
|
136
209
|
|
|
@@ -138,57 +211,69 @@ Because App Check attestation providers (like Play Integrity or DeviceCheck)
|
|
|
138
211
|
reject emulators, simulators, or CI environments, you must use **App Check Debug
|
|
139
212
|
Tokens** during development and testing to bypass standard attestation.
|
|
140
213
|
|
|
214
|
+
> [!WARNING] **CRITICAL: Never Hardcode or Commit Debug Tokens** App Check debug
|
|
215
|
+
> tokens allow clients to bypass attestation and access backend resources
|
|
216
|
+
> without a genuine device. Treat them as private secrets. **Never commit debug
|
|
217
|
+
> tokens to version control or hardcode raw token strings in client code** (Web,
|
|
218
|
+
> Android, iOS, or Flutter). Always inject them through local environment
|
|
219
|
+
> variables, gitignored local configurations, or CI secrets. If a token is
|
|
220
|
+
> compromised, revoke it immediately in the Firebase Console.
|
|
221
|
+
|
|
141
222
|
##### Local Development (Auto-Generated)
|
|
142
223
|
|
|
143
|
-
1.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
224
|
+
1. Configure your code's App Check provider to use the debug factory. The API is
|
|
225
|
+
platform-specific; see the App Check section of the platform reference or the
|
|
226
|
+
App Check documentation linked above.
|
|
227
|
+
1. Run your app in the emulator/localhost.
|
|
228
|
+
1. Look at your runtime debugger console / Logcat logs for the generated UUID:
|
|
229
|
+
- *Example:* `AppCheck debug token: "123a4567-b89c-12d3-e456-789012345678"`
|
|
230
|
+
1. Register this token in the Firebase Console under **Security > App Check >
|
|
231
|
+
Apps > Manage debug tokens**.
|
|
232
|
+
|
|
233
|
+
> **💡 Tip (Prevent Debug Token Churn):** Simulator or emulator resets, fresh
|
|
234
|
+
> installs, and clearing browser data can make the SDK generate a new debug
|
|
235
|
+
> token that you must register again. To keep a stable debug token without
|
|
236
|
+
> hardcoding it, see the App Check section of the platform reference.
|
|
154
237
|
|
|
155
238
|
##### CI/CD Pipelines (Pre-Provisioned)
|
|
156
239
|
|
|
157
|
-
1.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
process.env.APP_CHECK_DEBUG_TOKEN`).
|
|
240
|
+
1. Generate and register a new debug token in the Firebase Console under
|
|
241
|
+
**Security > App Check > Apps > Manage debug tokens**.
|
|
242
|
+
1. Add this token string as an encrypted secret in your CI system (e.g.
|
|
243
|
+
`APP_CHECK_DEBUG_TOKEN`).
|
|
244
|
+
1. Configure your build to pass this secret as an environment variable to the
|
|
245
|
+
SDK during test execution.
|
|
164
246
|
|
|
165
|
-
### Remote Config
|
|
247
|
+
### Firebase Remote Config
|
|
166
248
|
|
|
167
249
|
Consider that you do not need to hardcode model names (e.g., a specific model
|
|
168
250
|
version string). Use Firebase Remote Config to update model versions dynamically
|
|
169
251
|
without deploying new client code. See
|
|
170
252
|
[Changing model names remotely](https://firebase.google.com/docs/ai-logic/change-model-name-remotely.md.txt)
|
|
171
253
|
|
|
172
|
-
|
|
173
|
-
> (Flutter, Android, iOS, Web), you MUST run `npx firebase-tools init ailogic`
|
|
174
|
-
> to provision the service. `flutterfire configure` ONLY handles client
|
|
175
|
-
> configuration and does NOT enable the AI service, leading to
|
|
176
|
-
> `PERMISSION_DENIED` errors.
|
|
254
|
+
______________________________________________________________________
|
|
177
255
|
|
|
178
256
|
## Initialization Code References
|
|
179
257
|
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
258
|
+
- **Android (Kotlin)**
|
|
259
|
+
|
|
260
|
+
- Gemini API Provider: Gemini Developer API
|
|
261
|
+
- Reference: [usage_patterns_android.md](references/usage_patterns_android.md)
|
|
262
|
+
|
|
263
|
+
- **iOS (Swift)**
|
|
264
|
+
|
|
265
|
+
- Gemini API Provider: Gemini Developer API
|
|
266
|
+
- Reference: [ios_setup.md](references/ios_setup.md)
|
|
267
|
+
|
|
268
|
+
- **Web Modular API**
|
|
269
|
+
|
|
270
|
+
- Gemini API Provider: Gemini Developer API
|
|
271
|
+
- Reference: [usage_patterns_web.md](references/usage_patterns_web.md)
|
|
272
|
+
|
|
273
|
+
- **Flutter (Dart)**
|
|
274
|
+
|
|
275
|
+
- Gemini API Provider: Gemini Developer API
|
|
276
|
+
- Reference: [flutter_setup.md](references/flutter_setup.md)
|
|
192
277
|
|
|
193
278
|
> [!WARNING] **CRITICAL: Use current model names:** Always check the
|
|
194
279
|
> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)
|
|
@@ -197,8 +282,9 @@ without deploying new client code. See
|
|
|
197
282
|
|
|
198
283
|
## References
|
|
199
284
|
|
|
200
|
-
[
|
|
285
|
+
[Android (Kotlin) SDK usage patterns](references/usage_patterns_android.md)
|
|
201
286
|
[iOS SDK code examples and usage patterns](references/ios_setup.md)
|
|
202
|
-
[
|
|
287
|
+
[Web SDK setup, code examples, and usage patterns](references/usage_patterns_web.md)
|
|
203
288
|
|
|
204
|
-
[
|
|
289
|
+
[Flutter SDK code examples and usage patterns](references/flutter_setup.md)
|
|
290
|
+
[Client-side Text-to-Speech (TTS) generation](references/tts_generation.md)
|
|
@@ -96,3 +96,40 @@ final chat = model.startChat(history: [
|
|
|
96
96
|
|
|
97
97
|
final response = await chat.sendMessage(Content.text('What is CBT?'));
|
|
98
98
|
```
|
|
99
|
+
|
|
100
|
+
## App Check Debug Provider
|
|
101
|
+
|
|
102
|
+
For App Check debug tokens during local development and CI/CD, add the plugin
|
|
103
|
+
with `flutter pub add firebase_app_check`, then activate the debug providers
|
|
104
|
+
right after `Firebase.initializeApp()`:
|
|
105
|
+
|
|
106
|
+
```dart
|
|
107
|
+
import 'package:firebase_app_check/firebase_app_check.dart';
|
|
108
|
+
import 'package:flutter/foundation.dart';
|
|
109
|
+
|
|
110
|
+
// In main(), after `await Firebase.initializeApp();`
|
|
111
|
+
if (kDebugMode) {
|
|
112
|
+
await FirebaseAppCheck.instance.activate(
|
|
113
|
+
providerAndroid: const AndroidDebugProvider(),
|
|
114
|
+
providerApple: const AppleDebugProvider(),
|
|
115
|
+
providerWeb: WebDebugProvider(),
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
- Use `providerAndroid`, `providerApple`, and `providerWeb`. The older
|
|
121
|
+
`androidProvider` and `appleProvider` parameters (`AndroidProvider.debug`,
|
|
122
|
+
`AppleProvider.debug`) still appear in many examples but are deprecated.
|
|
123
|
+
- Only use the debug providers in debug builds, as gated by `kDebugMode` above.
|
|
124
|
+
Release builds must activate the production providers (Play Integrity, App
|
|
125
|
+
Attest or DeviceCheck, and reCAPTCHA Enterprise) instead; see
|
|
126
|
+
[App Check for Firebase AI Logic](https://firebase.google.com/docs/ai-logic/app-check.md.txt).
|
|
127
|
+
- **CI/CD**: Pass the pre-provisioned token to all three debug providers, e.g.
|
|
128
|
+
`debugToken: const String.fromEnvironment('APP_CHECK_DEBUG_TOKEN')`, and build
|
|
129
|
+
with `--dart-define=APP_CHECK_DEBUG_TOKEN=<token>`.
|
|
130
|
+
- **Flutter web**: `providerWeb` is required on web; without it, `activate()`
|
|
131
|
+
throws. `WebDebugProvider` turns on the web debug token itself, so
|
|
132
|
+
`web/index.html` doesn't need `self.FIREBASE_APPCHECK_DEBUG_TOKEN`.
|
|
133
|
+
- If the app uses `firebase_ai` 3.11.0 or lower, also set the `appCheck`
|
|
134
|
+
parameter of `FirebaseAI.googleAI(...)` to `FirebaseAppCheck.instance`. Newer
|
|
135
|
+
versions don't need this.
|
|
@@ -3,17 +3,46 @@
|
|
|
3
3
|
## 1. Import and Initialize
|
|
4
4
|
|
|
5
5
|
Ensure you have installed the `FirebaseAILogic` SDK via Swift Package Manager.
|
|
6
|
+
Use the `xcode-project-setup` skill to automate adding the SPM dependency to the
|
|
7
|
+
Xcode project.
|
|
6
8
|
|
|
7
9
|
```swift
|
|
8
10
|
import FirebaseAILogic
|
|
9
11
|
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
+
// To enable replay protection for generative or preview models, pass
|
|
13
|
+
// useLimitedUseAppCheckTokens: true with your backend:
|
|
14
|
+
let ai = FirebaseAI.firebaseAI(
|
|
15
|
+
backend: .googleAI(),
|
|
16
|
+
useLimitedUseAppCheckTokens: true
|
|
17
|
+
)
|
|
12
18
|
|
|
13
19
|
// [AGENT] Replace "<latest_supported_model>" with the latest model from https://firebase.google.com/docs/ai-logic/models.md.txt
|
|
14
20
|
let model = ai.generativeModel(modelName: "<latest_supported_model>")
|
|
15
21
|
```
|
|
16
22
|
|
|
23
|
+
### App Check Replay Protection
|
|
24
|
+
|
|
25
|
+
Generative and preview models enforce replay protection with 5-minute
|
|
26
|
+
limited-use App Check tokens. If you call a protected model without enabling
|
|
27
|
+
limited-use tokens, the request fails with:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
HTTP 403: "To access this model, you must enforce Firebase App Check"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
To resolve this error, initialize `FirebaseAI` with
|
|
34
|
+
`useLimitedUseAppCheckTokens: true`:
|
|
35
|
+
|
|
36
|
+
```swift
|
|
37
|
+
let ai = FirebaseAI.firebaseAI(
|
|
38
|
+
backend: .googleAI(),
|
|
39
|
+
useLimitedUseAppCheckTokens: true
|
|
40
|
+
)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This ensures the SDK fetches a fresh, short-lived limited-use token for each
|
|
44
|
+
request rather than reusing a standard cached App Check token.
|
|
45
|
+
|
|
17
46
|
## 2. SwiftUI Integration (Best Practices)
|
|
18
47
|
|
|
19
48
|
Use the `@Observable` pattern to manage AI state and provide a smooth UX with
|
|
@@ -33,7 +62,10 @@ import FirebaseAILogic
|
|
|
33
62
|
@Observable
|
|
34
63
|
final class AIViewModel {
|
|
35
64
|
// [AGENT] Replace with the latest model from https://firebase.google.com/docs/ai-logic/models.md.txt
|
|
36
|
-
private lazy var model = FirebaseAI.firebaseAI(
|
|
65
|
+
private lazy var model = FirebaseAI.firebaseAI(
|
|
66
|
+
backend: .googleAI(),
|
|
67
|
+
useLimitedUseAppCheckTokens: true
|
|
68
|
+
).generativeModel(modelName: "<latest_supported_model>")
|
|
37
69
|
|
|
38
70
|
var responseText: String = ""
|
|
39
71
|
var isFetching: Bool = false
|
|
@@ -98,6 +130,68 @@ let model = FirebaseAI.firebaseAI().generativeModel(
|
|
|
98
130
|
)
|
|
99
131
|
```
|
|
100
132
|
|
|
133
|
+
## 4. App Check Debug Provider
|
|
134
|
+
|
|
135
|
+
For App Check debug tokens during local development and CI/CD, add the
|
|
136
|
+
`FirebaseAppCheck` product to the app target (with the `xcode-project-setup`
|
|
137
|
+
skill), then set the debug provider factory in debug builds *before*
|
|
138
|
+
`FirebaseApp.configure()`. Otherwise the debug provider isn't used.
|
|
139
|
+
|
|
140
|
+
```swift
|
|
141
|
+
import FirebaseAppCheck
|
|
142
|
+
import FirebaseCore
|
|
143
|
+
|
|
144
|
+
// In your app's init(), before configuring Firebase:
|
|
145
|
+
#if DEBUG
|
|
146
|
+
AppCheck.setAppCheckProviderFactory(AppCheckDebugProviderFactory())
|
|
147
|
+
#endif
|
|
148
|
+
FirebaseApp.configure()
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
For CI/CD, add an `AppCheckDebugToken` environment variable to the Xcode test
|
|
152
|
+
scheme with a value like `$(APP_CHECK_DEBUG_TOKEN)`, then pass the token from
|
|
153
|
+
the CI test command:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
xcodebuild test -scheme <scheme> -workspace <project>.xcworkspace \
|
|
157
|
+
APP_CHECK_DEBUG_TOKEN=<token>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Debug Token Persistence
|
|
161
|
+
|
|
162
|
+
When running on simulators or during development, the Firebase iOS SDK generates
|
|
163
|
+
a new debug token UUID whenever `NSUserDefaults` is cleared (e.g., simulator
|
|
164
|
+
reset or fresh install). To avoid invalidating tokens registered in the Firebase
|
|
165
|
+
Console and prevent token churn, persist a stable token by setting the
|
|
166
|
+
`AppCheckDebugToken` environment variable, which the SDK reads automatically at
|
|
167
|
+
runtime:
|
|
168
|
+
|
|
169
|
+
> [!WARNING] **CRITICAL: Never Hardcode or Commit Debug Tokens** Debug tokens
|
|
170
|
+
> grant access to backend resources without device attestation. Never commit
|
|
171
|
+
> debug tokens to version control or hardcode token strings in source code.
|
|
172
|
+
|
|
173
|
+
- **In Xcode Scheme (Recommended):** Edit Scheme -> Run -> Arguments ->
|
|
174
|
+
Environment Variables -> Add `AppCheckDebugToken = <YOUR_DEBUG_TOKEN>`. Keep
|
|
175
|
+
user schemes (`xcuserdata/`) unshared and gitignored.
|
|
176
|
+
- **In Code (Safe Dynamic Loading Only):** If setting the environment variable
|
|
177
|
+
in code before configuring `AppCheckDebugProviderFactory`, load the token
|
|
178
|
+
dynamically from a gitignored local file or environment rather than hardcoding
|
|
179
|
+
the token literal:
|
|
180
|
+
|
|
181
|
+
```swift
|
|
182
|
+
#if DEBUG
|
|
183
|
+
// ✅ SAFE: Load from gitignored local file or process environment
|
|
184
|
+
// Note: loadGitIgnoredDebugToken() is a placeholder for your custom helper (e.g., reading from a gitignored plist)
|
|
185
|
+
if let debugToken = loadGitIgnoredDebugToken() {
|
|
186
|
+
setenv("AppCheckDebugToken", debugToken, 0)
|
|
187
|
+
}
|
|
188
|
+
let providerFactory = AppCheckDebugProviderFactory()
|
|
189
|
+
AppCheck.setAppCheckProviderFactory(providerFactory)
|
|
190
|
+
#endif
|
|
191
|
+
|
|
192
|
+
FirebaseApp.configure() // Configure Firebase AFTER setting the App Check provider factory
|
|
193
|
+
```
|
|
194
|
+
|
|
101
195
|
# Advanced Features
|
|
102
196
|
|
|
103
197
|
### Chat Session (Multi-turn)
|