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 renamed to fetchFoodItemForPassioID,

  • Now use fetchFoodItemForProductCode instead of fetchAttributesForBarcode and fetchPassioIDAttributesForPackagedFood and now returns a PassioFoodItem result

  • Fixed typo mistake of onDownloadingPassioModelCallBacks

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

fetchFoodItemForProductCode(code: Barcode | 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>

fetchFoodItemForDataInfo(passioFoodDataInfo: PassioFoodDataInfo): 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


New APIs

  • fetchSearchResult returns a PassioFoodItem object for a given PassioSearchResult

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

fetchFoodItemForDataInfo(result: PassioFoodDataInfo): 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:


   unit: calculatedWeightUnit,
   value: calculatedWeight,


Last updated