getAttributesForPassioID

Import

import {
  PassioSDK,
  type PassioFoodItem,
  type PassioID,
} from '@passiolife/nutritionai-react-native-sdk-v3'
/**
   * Look up the nutrition attributes for a given Passio ID.
   * @param passioID - The Passio ID for the attributes query.
   * @returns A `Promise` resolving to a `PassioFoodItem` object if the record exists in the database or `null` if not.
   */
  getAttributesForPassioID(passioID: PassioID): Promise<PassioFoodItem | null>

Example

It's return PassioFoodItem

const getFoodItem = async (passioID: PassioID) => {
  try {
    const passioFoodItem = await PassioSDK.getAttributesForPassioID(passioID)
  } catch (error) {
    console.log('error', error)
  }
}

Last updated