• Preparing search index...
  • The search index is not available
Genkit JS API reference
  • Genkit JS API reference
  • @genkit-ai/firebase
  • context
  • firebaseContext

Function firebaseContext

  • firebaseContext<I = any>(): FirebaseContextProvider<I>
  • Calling firebaseContext() without any parameters merely parses firebase context data. It does not do any validation on the data found. To do automatic validation, pass either an options object or function for freeform validation.

    Type Parameters

    • I = any

    Returns FirebaseContextProvider<I>

    • Defined in plugins/firebase/src/context.ts:162
  • firebaseContext<I = any>(policy: DeclarativePolicy): FirebaseContextProvider<I>
  • Calling firebaseContext() with a declarative policy both parses and enforces context. Honors the same environment variables that Cloud Functions for Firebase does to mock token validation in preproduction environmets.

    Type Parameters

    • I = any

    Parameters

    • policy: DeclarativePolicy

    Returns FirebaseContextProvider<I>

    • Defined in plugins/firebase/src/context.ts:169
  • firebaseContext<I = any>(
        policy: (context: FirebaseContext, input: I) => void | Promise<void>,
    ): FirebaseContextProvider<I>
  • Calling firebaseContext() with a policy callback parses context but delegates enforcement. To control the message sent to a user, throw UserFacingError. For security reasons, other error types will be returned as a 500 "internal error".

    Type Parameters

    • I = any

    Parameters

    • policy: (context: FirebaseContext, input: I) => void | Promise<void>

    Returns FirebaseContextProvider<I>

    • Defined in plugins/firebase/src/context.ts:178

Settings

Member Visibility
Genkit JS API reference
  • Loading...

Generated using TypeDoc with typedoc-github-theme