Official TypeScript/JavaScript SDK for the Food Context Protocol.
# npm
npm install @fcp/sdk
# yarn
yarn add @fcp/sdk
# pnpm
pnpm add @fcp/sdkimport { FCPClient } from "@fcp/sdk";
// Initialize client
const client = new FCPClient({
baseUrl: "https://fcp.dev",
apiKey: "your-api-key"
});
// Analyze a meal photo
const result = await client.analyze.analyzeMeal({
imageUrl: "https://example.com/food.jpg"
});
console.log(result.nutrition);
// Search recipes
const recipes = await client.recipes.searchRecipes({
query: "high protein breakfast",
maxResults: 5
});
// Check food recalls
const recalls = await client.safety.checkFoodRecalls({
foodItem: "romaine lettuce"
});- ✅ Type-safe - Full TypeScript types and intellisense
- ✅ Tree-shakeable - Optimized bundle size
- ✅ 40+ endpoints - Nutrition, recipes, safety, inventory, planning
- ✅ Auto-generated - Always in sync with the API via Fern
- Node.js 18+
- TypeScript 5.0+ (optional)
Apache-2.0 - See LICENSE
Generated by Fern from the Food Context Protocol OpenAPI specification.