'use client'; import { useState, useCallback } from 'react'; import { useUser } from '../layout/user.context'; import { Button } from '@gitroom/react/form/button'; import copy from 'copy-to-clipboard'; import { useToaster } from '@gitroom/react/toaster/toaster'; import { useVariables } from '@gitroom/react/helpers/variable.context'; export const PublicComponent = () => { const user = useUser(); const {frontEndUrl} = useVariables(); const toaster = useToaster(); const [reveal, setReveal] = useState(false); const [reveal2, setReveal2] = useState(false); const copyToClipboard = useCallback(() => { toaster.show('API Key copied to clipboard', 'success'); copy(user?.publicApi!); }, [user]); if (!user || !user.publicApi) { return null; } return (

Public API

Use Postiz API to integrate with your tools.
Read how to use it over the documentation.
{reveal ? ( user.publicApi ) : ( <>
{user.publicApi.slice(0, -5)}
{user.publicApi.slice(-5)}
)}
{!reveal ? ( ) : ( )}

MCP

Connect your MCP client to Postiz to schedule your posts faster!
{reveal2 ? ( `${frontEndUrl}/mcp/` + user.publicApi + '/sse' ) : ( <>
{(`${frontEndUrl}/mcp/` + user.publicApi + '/sse').slice(0, -5)}
{(`${frontEndUrl}/mcp/` + user.publicApi + '/sse').slice(-5)}
)}
{!reveal2 ? ( ) : ( )}
); };