Skip to main content
Glama
retrievePriceId.ts917 B
import { Period, Plans } from '@components/PricingPage/data.content'; const pricing = { [Period.Monthly]: { [Plans.Premium]: { priceId: process.env.NEXT_PUBLIC_STRIPE_PREMIUM_MONTHLY_PRICE_ID!, }, [Plans.Enterprise]: { priceId: process.env.NEXT_PUBLIC_STRIPE_ENTERPRISE_MONTHLY_PRICE_ID!, }, }, [Period.Yearly]: { [Plans.Premium]: { priceId: process.env.NEXT_PUBLIC_STRIPE_PREMIUM_YEARLY_PRICE_ID!, }, [Plans.Enterprise]: { priceId: process.env.NEXT_PUBLIC_STRIPE_ENTERPRISE_YEARLY_PRICE_ID!, }, }, }; export const retrievePriceId = ( plan: Plans, period: Period ): string | undefined => { if ( !pricing[period as keyof typeof pricing]?.[ plan as keyof (typeof pricing)[Period] ]?.priceId ) { return undefined; } return pricing[period as keyof typeof pricing][ plan as keyof (typeof pricing)[Period] ].priceId; };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server