Genkit JS API reference
    Preparing search index...

    Helper methods that provide most common needs for an authorization policy.

    interface DeclarativePolicy {
        consumeAppCheckToken?: boolean;
        emailVerified?: boolean;
        enforceAppCheck?: boolean;
        hasClaim?: string | Record<string, string> | string[];
        serverAppConfig?: FirebaseApp | FirebaseOptions;
        signedIn?: boolean;
    }
    Index

    Properties

    consumeAppCheckToken?: boolean

    Whether app check enforcement includes consuming tokens. Consuming tokens adds more security at the cost of performance.

    emailVerified?: boolean

    Requires the user's email to be verified. Requires the user to be signed in.

    enforceAppCheck?: boolean

    Whether appCheck must be enforced

    hasClaim?: string | Record<string, string> | string[]

    Clam or Claims that must be present in the request. Can be a singel claim name or array of claim names to merely test the presence of a clam or can be an object of claim names and values that must be present. Requires the user to be signed in.

    serverAppConfig?: FirebaseApp | FirebaseOptions

    Either a FirebaseApp or the options used to initialize one. When provided, context.firebaseApp will be populated as a FirebaseServerApp with the current request's auth and app check credentials allowing you to perform actions using Firebase Client SDKs authenticated as the requesting user.

    You must have the firebase dependency in your package.json to use this option.

    signedIn?: boolean

    Requires the user to be signed in or not. Implicitly part of hasClaims.