Files
outline/plugins/iframely/server/index.ts
Apoorv Mishra bd2b32f9d5 Helper for cache related utilities (#6696)
Co-authored-by: Tom Moor <tom@getoutline.com>
2024-03-21 16:49:38 -07:00

23 lines
542 B
TypeScript

import { Day } from "@shared/utils/time";
import {
PluginManager,
PluginPriority,
Hook,
} from "@server/utils/PluginManager";
import env from "./env";
import Iframely from "./iframely";
const enabled = !!env.IFRAMELY_API_KEY && !!env.IFRAMELY_URL;
if (enabled) {
PluginManager.add([
{
type: Hook.UnfurlProvider,
value: { unfurl: Iframely.unfurl, cacheExpiry: Day },
// Make sure this is last in the stack to be evaluated after all other unfurl providers
priority: PluginPriority.VeryLow,
},
]);
}