• 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.

    Parameters

    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);
    }