Files
outline/plugins/iframely/server/index.ts
Apoorv Mishra 85c8f83e33 PluginManager refactor (#6677)
* fix: refactor plugin manager

* fix: make id optional

* fix: allow add to accept single object

* fix: getHooks

* fix: tsc

* fix: remove id
2024-03-16 21:22:25 +05:30

22 lines
467 B
TypeScript

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: Iframely.get,
// Make sure this is last in the stack to be evaluated after all other unfurl providers
priority: PluginPriority.VeryLow,
},
]);
}