Skip to content

How-To: Postiz Integration Quick Setup

2026 Verification Notes

A system-wide scan has verified that the class names, file paths, and Artisan commands mentioned in this guide are accurate and consistent with the current application structure. Please note that environment-specific URLs (e.g., social.ohm.events) should be replaced with your local equivalents during development.

This guide explains how to set up and use the Postiz integration, allowing users to connect their social media accounts and schedule posts directly from the AIOHM platform.

Table of Contents


📋 Overview

This integration allows each tenant/brand to connect their own Facebook, Instagram, and Google Business profiles directly from the AIOHM admin panel and schedule posts with one click.

Architecture:

  • A tenant logs into their AIOHM admin panel.
  • They navigate to the "Social Media Manager" page.
  • Clicking "Connect" redirects them to Postiz, which handles the secure OAuth flow with the social media platforms.
  • Once connected, they can schedule posts via the "Post Scheduler" page.

🛠️ Installation Steps

Step 1: Verify Postiz is Running

For local development, ensure the Postiz Docker container is running.

bash
# Check if Postiz Docker container is running
docker ps | grep postiz

Step 2: Verify Environment Variables

Ensure your .env file has the correct Postiz configuration. Do not commit API keys to version control.

dotenv
# .env
POSTIZ_API_URL=https://social.ohm.events/api
POSTIZ_API_KEY=<YOUR_POSTIZ_API_KEY>

Step 3: Clear Application Cache

To ensure all configuration is loaded correctly, clear the Laravel caches.

bash
php artisan config:clear
php artisan cache:clear
php artisan view:clear

👨‍💻 Usage for Tenants

1. Connect Social Media Accounts

  1. Login to the AIOHM admin panel.
  2. Navigate to Content Management → Social Media.
  3. Click the "Connect" button for Facebook, Instagram, or Google Business.
  4. You will be redirected to Postiz to securely log in with your social media account and grant permissions.
  5. After authorization, you are redirected back to AIOHM, and the account will appear as connected.

2. Schedule Posts

  1. Navigate to Content Management → Post Scheduler.
  2. Compose your post content and optionally upload images.
  3. Select which of your connected accounts to post to.
  4. Choose to "Publish Now" or set a future date and time.
  5. Click "Schedule Post". The post is now queued in Postiz.

🔧 Google Business Profile Setup

To allow tenants to connect their Google Business Profile accounts, the Postiz service itself must be configured with Google OAuth credentials.

Step 1: Create Google Cloud OAuth Credentials

  1. Go to the Google Cloud Console and create a new OAuth Client ID for a "Web application".
  2. In the credential settings, add the following Authorized redirect URIs, pointing to your Postiz instance:
    https://<your-postiz-domain.com>/integrations/social/gmb
    https://<your-postiz-domain.com>/auth/callback/gmb
  3. Copy the generated Client ID and Client Secret.

Step 2: Configure Postiz

  1. Log in to your Postiz admin panel (e.g., http://social.ohm.events:5000).
  2. Navigate to Settings → OAuth Providers.
  3. Find Google Business Profile and enter the Client ID and Client Secret you just copied.
  4. Save the configuration.

Once Postiz is configured, tenants will be able to authorize their Google Business Profile accounts seamlessly through the AIOHM platform.


⚙️ Technical Details

The integration works by using the PostizIntegrationService as a bridge to the Postiz API. The frontend UI is built with Livewire components and Filament pages.

Authentication Flow: The SocialMediaConnector Livewire component builds a secure OAuth URL that sends the user to Postiz. Postiz handles the complex token exchange with the social platforms and redirects the user back to AIOHM upon success.

Scheduling Flow: The PostizScheduler Livewire component fetches a list of the user's connected accounts from Postiz and provides the UI for composing a post. When a post is scheduled, it makes an API call to Postiz, which then handles the queuing and publishing.

Key Files

  • Service: app/Services/PostizIntegrationService.php
  • Livewire Components: app/Livewire/SocialMediaConnector.php, app/Livewire/PostizScheduler.php
  • Filament Pages: app/Filament/Pages/SocialMediaManager.php, app/Filament/Pages/PostScheduler.php

🐛 Troubleshooting

Issue: "Postiz service is not available"

Ensure the Postiz Docker container is running.

bash
docker-compose up -d postiz
# Then test the health endpoint:
curl http://social.ohm.events:5000/health

Issue: "Invalid API key"

  1. Generate a new API key from your Postiz instance (Settings → API Keys).
  2. Update the POSTIZ_API_KEY value in your .env file.
  3. Clear the config cache: php artisan config:clear

Issue: Posts not appearing in the scheduler

Use Tinker to test the service directly and see what the API is returning.

bash
php artisan tinker
>>> $service = app(\App\Services\PostizIntegrationService::class);
>>> $integrations = $service->getIntegrations('your-tenant-id');
>>> dd($integrations);

🎨 Customization

The UI can be customized by editing the Blade views for the Livewire components:

  • resources/views/livewire/social-media-connector.blade.php
  • resources/views/livewire/postiz-scheduler.blade.php

New platforms can be added by extending the platform map in the Livewire components.


🔒 API Key Security

The POSTIZ_API_KEY is a sensitive credential.

  • Always store it in .env files.
  • Never commit .env files or hardcode the key in your application code.
  • Use .env.example to document the required variable for other developers.
  • Rotate the API key periodically for enhanced security.

Released under the MIT License.