Skip to content

    toJSON

    Serialize the client configuration when you need to check which API origin an integration uses.

    Signature

    client.toJSON(): Record<string, string>

    Parameters

    This method takes no arguments.

    Return value

    An object with one field, baseUrl. JSON.stringify(client) calls this method and excludes the API key.

    Errors

    • This method takes no input and makes no network request.

    TypeScript example

    import { AeoClient } from "@aeoapi/aeo-sdk";
    
    const apiKey = process.env.AEO_API_KEY;
    if (!apiKey) throw new Error("Set AEO_API_KEY on your server.");
    const client = new AeoClient(apiKey, { baseUrl: "https://api.aeoapi.dev" });
    
    console.log(client.toJSON());

    See TypeScript client setup for authentication, timeouts and retry settings.