The Klaviyo React Native SDK Interface

This interface extends the KlaviyoEventAPI and KlaviyoProfileApi interfaces, providing a unified API for interacting with Klaviyo's event tracking and profile management features.

interface KlaviyoInterface {
    createEvent(event): void;
    getEmail(callback): null | string;
    getExternalId(callback): null | string;
    getPhoneNumber(callback): null | string;
    getPushToken(callback): null | string;
    initialize(apiKey): void;
    registerForInAppForms(): void;
    resetProfile(): void;
    setBadgeCount(count): void;
    setEmail(email): void;
    setExternalId(externalId): void;
    setPhoneNumber(phoneNumber): void;
    setProfile(profile): void;
    setProfileAttribute(propertyKey, value): void;
    setPushToken(token): void;
}

Hierarchy

  • KlaviyoEventAPI
  • KlaviyoProfileApi
  • KlaviyoPushApi
  • KlaviyoFormsApi
    • KlaviyoInterface

Methods

  • Create a new event to track a profile's activity.

    Parameters

    • event: Event

      The event to track

    Returns void

  • Retrieve a profile's email address.

    Parameters

    • callback: undefined | Function

      The callback function to handle the response

    Returns null | string

  • Retrieve a profile's external ID.

    Parameters

    • callback: undefined | Function

      The callback function to handle the response

    Returns null | string

  • Retrieve a profile's phone number.

    Parameters

    • callback: undefined | Function

      The callback function to handle the response

    Returns null | string

  • Get the push token for the current profile from the SDK

    Parameters

    • callback: undefined | Function

    Returns null | string

  • Initializes the Klaviyo SDK with the given API key.

    Parameters

    • apiKey: string

      Your public API key

    Returns void

  • Load in-app forms data and display a form to the user if applicable based on the forms configured in your Klaviyo account. Note [Klaviyo.initialize] must be called first

    Returns void

  • Clear the current profile and set it to a new anonymous profile

    Returns void

  • Set the badge count for the app icon

    Parameters

    • count: number

    Returns void

  • Update a profile's email address.

    Parameters

    • email: string

      The email address to set

    Returns void

  • Update a profile's external ID.

    Parameters

    • externalId: string

      The external ID to set

    Returns void

  • Update a profile's phone number.

    Parameters

    • phoneNumber: string

      The phone number to set

    Returns void

  • Create and update properties about a profile without tracking an associated event.

    Parameters

    • profile: Profile

      The profile object to set

    Returns void

  • Update a profile's properties.

    Parameters

    • propertyKey: ProfilePropertyKey

      The property key to set

    • value: string

      The property value to set

    Returns void

  • Set the push token for the current profile

    Parameters

    • token: string

    Returns void