API Reference
    Preparing search index...

    Variable CreateAuthChallengeTriggerSchemaConst

    CreateAuthChallengeTriggerSchema: ZodObject<
        {
            callerContext: ZodObject<
                { awsSdkVersion: ZodString; clientId: ZodString },
                "strip",
                ZodTypeAny,
                { awsSdkVersion: string; clientId: string },
                { awsSdkVersion: string; clientId: string },
            >;
            region: ZodString;
            userName: ZodOptional<ZodString>;
            userPoolId: ZodString;
            version: ZodString;
        } & {
            request: ZodObject<
                {
                    challengeName: ZodString;
                    clientMetadata: ZodOptional<ZodRecord<ZodString, ZodString>>;
                    session: ZodArray<
                        ZodObject<
                            {
                                challengeMetadata: ZodOptional<ZodString>;
                                challengeName: ZodUnion<
                                    [
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                        ZodLiteral<(...)>,
                                    ],
                                >;
                                challengeResult: ZodBoolean;
                            },
                            "strip",
                            ZodTypeAny,
                            {
                                challengeMetadata?: string;
                                challengeName: | "CUSTOM_CHALLENGE"
                                | "SRP_A"
                                | "PASSWORD_VERIFIER"
                                | "SMS_MFA"
                                | "EMAIL_OTP"
                                | "SOFTWARE_TOKEN_MFA"
                                | "DEVICE_SRP_AUTH"
                                | "DEVICE_PASSWORD_VERIFIER"
                                | "ADMIN_NO_SRP_AUTH";
                                challengeResult: boolean;
                            },
                            {
                                challengeMetadata?: string;
                                challengeName: | "CUSTOM_CHALLENGE"
                                | "SRP_A"
                                | "PASSWORD_VERIFIER"
                                | "SMS_MFA"
                                | "EMAIL_OTP"
                                | "SOFTWARE_TOKEN_MFA"
                                | "DEVICE_SRP_AUTH"
                                | "DEVICE_PASSWORD_VERIFIER"
                                | "ADMIN_NO_SRP_AUTH";
                                challengeResult: boolean;
                            },
                        >,
                        "many",
                    >;
                    userAttributes: ZodRecord<ZodString, ZodString>;
                    userNotFound: ZodOptional<ZodBoolean>;
                },
                "strip",
                ZodTypeAny,
                {
                    challengeName: string;
                    clientMetadata?: Record<string, string>;
                    session: {
                        challengeMetadata?: string;
                        challengeName:
                            | "CUSTOM_CHALLENGE"
                            | "SRP_A"
                            | "PASSWORD_VERIFIER"
                            | "SMS_MFA"
                            | "EMAIL_OTP"
                            | "SOFTWARE_TOKEN_MFA"
                            | "DEVICE_SRP_AUTH"
                            | "DEVICE_PASSWORD_VERIFIER"
                            | "ADMIN_NO_SRP_AUTH";
                        challengeResult: boolean;
                    }[];
                    userAttributes: Record<string, string>;
                    userNotFound?: boolean;
                },
                {
                    challengeName: string;
                    clientMetadata?: Record<string, string>;
                    session: {
                        challengeMetadata?: string;
                        challengeName:
                            | "CUSTOM_CHALLENGE"
                            | "SRP_A"
                            | "PASSWORD_VERIFIER"
                            | "SMS_MFA"
                            | "EMAIL_OTP"
                            | "SOFTWARE_TOKEN_MFA"
                            | "DEVICE_SRP_AUTH"
                            | "DEVICE_PASSWORD_VERIFIER"
                            | "ADMIN_NO_SRP_AUTH";
                        challengeResult: boolean;
                    }[];
                    userAttributes: Record<string, string>;
                    userNotFound?: boolean;
                },
            >;
            response: ZodObject<
                {
                    challengeMetadata: ZodOptional<ZodNullable<ZodString>>;
                    privateChallengeParameters: ZodOptional<
                        ZodNullable<ZodRecord<ZodString, ZodString>>,
                    >;
                    publicChallengeParameters: ZodOptional<
                        ZodNullable<ZodRecord<ZodString, ZodString>>,
                    >;
                },
                "strip",
                ZodTypeAny,
                {
                    challengeMetadata?: null
                    | string;
                    privateChallengeParameters?: null | Record<string, string>;
                    publicChallengeParameters?: null | Record<string, string>;
                },
                {
                    challengeMetadata?: null
                    | string;
                    privateChallengeParameters?: null | Record<string, string>;
                    publicChallengeParameters?: null | Record<string, string>;
                },
            >;
            triggerSource: ZodLiteral<"CreateAuthChallenge_Authentication">;
        },
        "strip",
        ZodTypeAny,
        {
            callerContext: { awsSdkVersion: string; clientId: string };
            region: string;
            request: {
                challengeName: string;
                clientMetadata?: Record<string, string>;
                session: {
                    challengeMetadata?: string;
                    challengeName:
                        | "CUSTOM_CHALLENGE"
                        | "SRP_A"
                        | "PASSWORD_VERIFIER"
                        | "SMS_MFA"
                        | "EMAIL_OTP"
                        | "SOFTWARE_TOKEN_MFA"
                        | "DEVICE_SRP_AUTH"
                        | "DEVICE_PASSWORD_VERIFIER"
                        | "ADMIN_NO_SRP_AUTH";
                    challengeResult: boolean;
                }[];
                userAttributes: Record<string, string>;
                userNotFound?: boolean;
            };
            response: {
                challengeMetadata?: null
                | string;
                privateChallengeParameters?: null | Record<string, string>;
                publicChallengeParameters?: null | Record<string, string>;
            };
            triggerSource: "CreateAuthChallenge_Authentication";
            userName?: string;
            userPoolId: string;
            version: string;
        },
        {
            callerContext: { awsSdkVersion: string; clientId: string };
            region: string;
            request: {
                challengeName: string;
                clientMetadata?: Record<string, string>;
                session: {
                    challengeMetadata?: string;
                    challengeName:
                        | "CUSTOM_CHALLENGE"
                        | "SRP_A"
                        | "PASSWORD_VERIFIER"
                        | "SMS_MFA"
                        | "EMAIL_OTP"
                        | "SOFTWARE_TOKEN_MFA"
                        | "DEVICE_SRP_AUTH"
                        | "DEVICE_PASSWORD_VERIFIER"
                        | "ADMIN_NO_SRP_AUTH";
                    challengeResult: boolean;
                }[];
                userAttributes: Record<string, string>;
                userNotFound?: boolean;
            };
            response: {
                challengeMetadata?: null
                | string;
                privateChallengeParameters?: null | Record<string, string>;
                publicChallengeParameters?: null | Record<string, string>;
            };
            triggerSource: "CreateAuthChallenge_Authentication";
            userName?: string;
            userPoolId: string;
            version: string;
        },
    > = ...

    A zod schema for a Cognito Create Auth Challenge trigger event.

    {
    "version": "1",
    "triggerSource": "CreateAuthChallenge_Authentication",
    "region": "us-east-1",
    "userPoolId": "us-east-1_ABC123",
    "userName": "johndoe",
    "callerContext": {
    "awsSdkVersion": "2.814.0",
    "clientId": "client123"
    },
    "request": {
    "userAttributes": { "email": "user@example.com", "name": "John Doe" },
    "challengeName": "CUSTOM_CHALLENGE",
    "session": [
    { "challengeName": "SRP_A", "challengeResult": true, "challengeMetadata": "metadata" }
    ],
    "clientMetadata": { "key": "value" },
    "userNotFound": false
    },
    "response": {
    "publicChallengeParameters": { "captchaUrl": "url/123.jpg" },
    "privateChallengeParameters": { "answer": "5" },
    "challengeMetadata": "custom metadata"
    }
    }