Migrating from SDK 2.X to version 3.X

Deprecated APIs

getAttributesForPassioID(passioID: PassioID): Promise<PassioIDAttributes | null>

fetchAttributesForBarcode(barcode: Barcode): Promise<PassioIDAttributes | null>

fetchPassioIDAttributesForPackagedFood(packagedFoodCode: PackagedFoodCode): Promise<PassioIDAttributes | null>

fetchSearchResult(result: FoodSearchResult): Promise<PassioIDAttributes | null>

onDowloadingPassioModelCallBacks: (downloadModelCallBack: DownloadModelCallBack) => Callback

Refactored APIs

  • getAttributesForPassioID, fetchAttributesForBarcode, fetchPassioIDAttributesForPackagedFood now returns a PassioFoodItem result

  • Fixed typo mistake of onDownloadingPassioModelCallBacks

getAttributesForPassioID(passioID: PassioID): Promise<PassioFoodItem | null>

fetchAttributesForBarcode(barcode: Barcode): Promise<PassioFoodItem | null>

fetchPassioIDAttributesForPackagedFood(packagedFoodCode: PackagedFoodCode): Promise<PassioFoodItem | null>

onDownloadingPassioModelCallBacks: (downloadModelCallBack: DownloadModelCallBack) => Callback
  • searchForFood now returns PassioSearchResult and a list of search options. The PassioSearchResult represent a specific food item associated with the search term, while search options provide a list of possible suggested search terms connected to the input term.

searchForFood(searchQuery: string): Promise<PassioSearchResult | null>

fetchSearchResult(result: FoodSearchResult): Promise<PassioFoodItem | null>

We now provide detailed information on macro nutrients in our food search queries, including calorie carbs, protein, and fat , among other nutritional data.

  • Now DetectedCandidate have alternatives and croppedImage

  • Added a few more nutrients in PassioNutrients

 zinc, 
 selenium, 
 folicAcid, 
 vitaminKPhylloquinone, 
 vitaminKMenaquinone4, 
 vitaminKDihydrophylloquinone, 
 chromium

New APIs

  • fetchSearchResult returns a PassioFoodItem object for a given PassioSearchResult

searchForFood(searchQuery: string): Promise<PassioSearchResult | null>

fetchSearchResult(result: FoodSearchResult): Promise<PassioFoodItem | null>
  • Added API to fetch suggestions for a certain meal time.

type MealTime = 'breakfast' | 'lunch' | 'dinner' | 'snack'

  fetchSuggestions(mealTime: MealTime): Promise<FoodSearchResult[] | null>

  fetchFoodItemForSuggestion(result: FoodSearchResult): Promise<PassioFoodItem | null>

  • To retrieve all macro and micronutrient values using PassioSDKby passing a passioFoodItem you would typically follow these steps:

PassioSDK.fetchNutrientsSelectedSizeForPassioFoodItem(passioFoodItem)

 PassioSDK.fetchNutrientsForPassioFoodItem(passioFoodItem,{
   unit: calculatedWeightUnit,
   value: calculatedWeight,
 })

PassioSDK.fetchNutrientsReferenceForPassioFoodItem(passioFoodItem)

Last updated