Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

feat(discord): global floating Discord widget with PostHog tracking

Paulo Castellanof41b28c31d2c
diff --git a/lang/en/common.php b/lang/en/common.php
index c348d641e..7d29a8b06 100644
--- a/lang/en/common.php
+++ b/lang/en/common.php
@@ -3,6 +3,12 @@
declare(strict_types=1);
return [
+
+ 'discord' => [
+ 'label' => 'Discord',
+ 'join' => 'Join our Discord community',
+ ],
+
'back' => 'Back',
'confirm_modal' => [
diff --git a/lang/es/common.php b/lang/es/common.php
index 261d31e35..115c05491 100644
--- a/lang/es/common.php
+++ b/lang/es/common.php
@@ -3,6 +3,12 @@
declare(strict_types=1);
return [
+
+ 'discord' => [
+ 'label' => 'Discord',
+ 'join' => 'Unite a nuestra comunidad en Discord',
+ ],
+
'back' => 'Volver',
'confirm_modal' => [
diff --git a/lang/pt-BR/common.php b/lang/pt-BR/common.php
index 0b0c2c51d..9826eebc1 100644
--- a/lang/pt-BR/common.php
+++ b/lang/pt-BR/common.php
@@ -3,6 +3,12 @@
declare(strict_types=1);
return [
+
+ 'discord' => [
+ 'label' => 'Discord',
+ 'join' => 'Entre na nossa comunidade no Discord',
+ ],
+
'back' => 'Voltar',
'confirm_modal' => [
diff --git a/resources/js/components/DiscordWidget.vue b/resources/js/components/DiscordWidget.vue
new file mode 100644
index 000000000..52e3d339f
--- /dev/null
+++ b/resources/js/components/DiscordWidget.vue
@@ -0,0 +1,27 @@
+<script setup lang="ts">
+import { IconBrandDiscord } from '@tabler/icons-vue';
+
+import { captureEvent } from '@/posthog';
+
+const DISCORD_URL = 'https://trypost.it/discord';
+
+// Distinct from the marketing site's site_discord_clicked, following the
+// app's noun.verb event convention.
+const trackClick = () => {
+ captureEvent('discord.clicked', { placement: 'floating_widget' });
+};
+</script>
+
+<template>
+ <a
+ :href="DISCORD_URL"
+ target="_blank"
+ rel="noopener noreferrer"
+ :aria-label="$t('common.discord.join')"
+ class="group fixed bottom-5 right-5 z-50 inline-flex items-center gap-2 rounded-full border-2 border-foreground bg-[#5865F2] py-2.5 pl-3 pr-4 text-sm font-bold text-white shadow-md transition-all hover:-translate-y-0.5 hover:shadow-lg"
+ @click="trackClick"
+ >
+ <IconBrandDiscord class="size-5 shrink-0" stroke-width="2" />
+ <span>{{ $t('common.discord.label') }}</span>
+ </a>
+</template>
diff --git a/resources/js/layouts/app/AppSidebarLayout.vue b/resources/js/layouts/app/AppSidebarLayout.vue
index 0329df332..13c6601ac 100644
--- a/resources/js/layouts/app/AppSidebarLayout.vue
+++ b/resources/js/layouts/app/AppSidebarLayout.vue
@@ -4,6 +4,7 @@ import { onBeforeUnmount, onMounted } from 'vue';
import AppHeader from '@/components/AppHeader.vue';
import AppSidebar from '@/components/AppSidebar.vue';
+import DiscordWidget from '@/components/DiscordWidget.vue';
import Toast from '@/components/Toast.vue';
import { SidebarInset, SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
import UpgradeDialog from '@/components/UpgradeDialog.vue';
@@ -76,4 +77,5 @@ onBeforeUnmount(() => {
</SidebarProvider>
<UpgradeDialog />
<Toast />
+ <DiscordWidget />
</template>