2
0
Files
bot/packages/lib/s3/getFileTempUrl.ts
2024-09-02 11:23:01 +02:00

15 lines
334 B
TypeScript

import { env } from '@typebot.io/env'
import { initClient } from './initClient'
type Props = {
key: string
expires?: number
}
export const getFileTempUrl = async ({
key,
expires,
}: Props): Promise<string> => {
const minioClient = initClient()
return minioClient.presignedGetObject(env.S3_BUCKET, key, expires ?? 3600)
}