Methods

  • Notifies multiple external agents of a login's occurrence.

    This method sends user login information to various external tracking and analytics services, including AppsFlyer, Facebook, Google, and Eitri Push Server. This enables proper user session tracking, attribution, and analytics across multiple platforms.

    Parameters

    • input: NotifyLoginInput

      Object containing user identification and contact information.

      Input parameters for notifying external agents about user login events.

      This interface defines the user information that will be sent to multiple external tracking and analytics services such as AppsFlyer, Facebook, Google, and Eitri Push Server.

      • [key: string]: undefined | string
      • customerId: string

        Unique identifier for the customer (required).

      • Optionalemail?: string

        User's email address in standard email format (optional).

      • Optionalphone?: string

        User's phone number, preferably in international format with country code (e.g., +1234567890) (optional).

    Returns Promise<undefined>

    Promise that resolves to undefined once the notification has been dispatched.

    • This method uses a fire-and-forget approach. Notifications are sent asynchronously without waiting for confirmation from external services, and failures are handled silently without throwing errors.
    • This method should be called immediately after a successful user authentication.
    • Providing email and phone (when available) improves tracking accuracy and user matching.
    • Additional custom properties can be passed through the input object's index signature, however, not all external agents will receive or process these additional properties. Each external service has its own implementation and may ignore properties that are not part of their expected data schema. There is no guarantee that custom properties will have any effect on tracking or analytics.

    Basic usage with required fields:

    await Eitri.exposedApis.session.notifyLogin({
    customerId: '12345'
    });

    Complete usage with all available fields:

    await Eitri.exposedApis.session.notifyLogin({
    customerId: '12345',
    email: '[email protected]',
    phone: '+5511999887766'
    });
  • Notifies multiple external agents of a logout's occurrence.

    This method sends logout notifications to various external tracking and analytics services, including AppsFlyer, Facebook, Google, and Eitri Push Server. This ensures proper session termination tracking and helps maintain accurate user session analytics across multiple platforms.

    Returns Promise<undefined>

    Promise that resolves to undefined once the notification has been dispatched.

    • This method uses a fire-and-forget approach. Notifications are sent asynchronously without waiting for confirmation from external services, and failures are handled silently without throwing errors.
    • This method should be called when a user explicitly logs out of the application.
    • Calling this method helps external services track user session duration accurately.
    • No parameters are required as the logout is associated with the current active session.

    Basic usage:

    await Eitri.exposedApis.session.notifyLogout();