fetchPassioIDAttributesForPackagedFood

Import

import {
  PassioSDK,
  type PassioFoodItem,
  type PackagedFoodCode,
} from '@passiolife/nutritionai-react-native-sdk-v3'

  /**
   * Query Passio's web service for nutrition attributes given an package food identifier.
   * @param packagedFoodCode - The code identifier for the attributes query, taken from the list of package food candidates on a `FoodDetectionEvent`.
   * @returns A `Promise` resolving to a `PassioFoodItem` object if the record exists in the database or `null` if not.
   */
  fetchPassioIDAttributesForPackagedFood(
    packagedFoodCode: PackagedFoodCode
  ): Promise<PassioFoodItem | null>

Example

Its' return PassioFoodItem

const getFoodItem = async (packagedFoodCode: PackagedFoodCode) => {
  try {
    const passioFoodItem = await PassioSDK.fetchPassioIDAttributesForPackagedFood(packagedFoodCode)
  } catch (error) {
    console.log('error', error)
  }
}

Last updated