mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
14 lines
283 B
TypeScript
14 lines
283 B
TypeScript
import { Mastodon } from "megalodon";
|
|
|
|
export const useMegalodon = async (disableOnServer = false) => {
|
|
if (disableOnServer && process.server) {
|
|
return null;
|
|
}
|
|
|
|
const baseUrl = useBaseUrl().value;
|
|
|
|
const client = new Mastodon(baseUrl);
|
|
|
|
return client;
|
|
};
|