MonoCloud Authentication SDK
    Preparing search index...
    • Creates a Fastify onRequest hook factory for protecting API routes using a pre-configured client.

      Parameters

      • client: MonoCloudBackendNodeClient

        A pre-configured MonoCloudBackendNodeClient instance.

      • Optionaloptions: ProtectApiRequestOptions<
            FastifyRequest<
                RouteGenericInterface,
                RawServerDefault,
                IncomingMessage,
                FastifySchema,
                FastifyTypeProviderDefault,
                unknown,
                FastifyBaseLogger,
                ResolveFastifyRequestType<
                    FastifyTypeProviderDefault,
                    FastifySchema,
                    RouteGenericInterface,
                >,
            >,
        >

        Options for extracting tokens and certificates from the request.

      Returns ProtectHook

    • Creates a Fastify onRequest hook factory for protecting API routes.

      A new MonoCloudBackendNodeClient is created from the provided options, or from environment variables.

      Parameters

      • Optionaloptions: ProtectApiRequestOptions<
            FastifyRequest<
                RouteGenericInterface,
                RawServerDefault,
                IncomingMessage,
                FastifySchema,
                FastifyTypeProviderDefault,
                unknown,
                FastifyBaseLogger,
                ResolveFastifyRequestType<
                    FastifyTypeProviderDefault,
                    FastifySchema,
                    RouteGenericInterface,
                >,
            >,
        >

        Options for extracting tokens and certificates from the request.

      Returns ProtectHook