mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 21:47:51 +00:00
16 lines
459 B
TypeScript
16 lines
459 B
TypeScript
import { OramaClient } from '@oramacloud/client'
|
|
|
|
const ORAMA_API_KEY = process.env.NEXT_PUBLIC_ORAMA_API_KEY!
|
|
const ORAMA_ENDPOINT = process.env.NEXT_PUBLIC_ORAMA_ENDPOINT!
|
|
|
|
export const orama = new OramaClient({
|
|
endpoint: ORAMA_ENDPOINT,
|
|
api_key: ORAMA_API_KEY
|
|
})
|
|
|
|
export function trimDescription(description: string, maxSize = 80) {
|
|
if (description.length > maxSize) {
|
|
return `${description.substring(0, maxSize)}...`
|
|
}
|
|
return description
|
|
} |