• Creates a journey client for AM authentication tree/journey interactions.

    Journey-client is designed specifically for ForgeRock Access Management (AM) servers. It uses AM-proprietary endpoints for callback-based authentication trees.

    Type Parameters

    Parameters

    • options: {
          config: JourneyClientConfig;
          logger?: {
              custom?: CustomLogger;
              level: "error" | "none" | "warn" | "info" | "debug";
          };
          requestMiddleware?: RequestMiddleware<ActionType>[];
          store?: SdkStore;
      }

      Configuration options for the journey client

      • config: JourneyClientConfig

        Configuration options (see JourneyClientConfig); only serverConfig.wellknown is required

      • Optionallogger?: { custom?: CustomLogger; level: "error" | "none" | "warn" | "info" | "debug" }

        Optional logger configuration

      • OptionalrequestMiddleware?: RequestMiddleware<ActionType>[]

        Optional middleware for request customization

      • Optionalstore?: SdkStore

        An existing SDK store to attach to, so discovery caching and state are shared with another client. Omit to create a store for this client alone.

    Returns Promise<JourneyClient>

    A journey client instance

    When the wellknown URL is invalid, the fetch fails, or the response indicates a non-AM server

    try {
    const client = await journey({
    config: {
    serverConfig: {
    wellknown: 'https://am.example.com/am/oauth2/alpha/.well-known/openid-configuration',
    },
    },
    });
    const step = await client.start({ journey: 'Login' });
    } catch (error) {
    console.error('Failed to initialize:', error.message);
    }