FoPost LogoFoPost Docs
Getting Started (Developers)

Quick Start (Standalone PHP)

Publish your first post with FoPost in minutes.

Quick Start - Standalone PHP

This guide gets you publishing to social media in under 5 minutes.

1. Install

composer require owlstack/cloud

2. Get your API key

  1. Sign up at app.owlstack.app
  2. Create a project
  3. Connect at least one social media platform via OAuth
  4. Copy your API key from the project settings

3. Publish your first post

<?php

require __DIR__ . '/vendor/autoload.php';

use OwlStack\Cloud\OwlStackClient;
use OwlStack\Post;
use OwlStack\Enums\Platform;

$client = new OwlStackClient(
    apiKey: getenv('OWLSTACK_API_KEY'),
);

$post = Post::create('Hello world! My first post via OwlStack.')
    ->withHashtags(['opensource', 'php']);

$result = $client->publish($post, [Platform::Telegram]);

if ($result->isSuccessful()) {
    echo "Published! URL: {$result->externalUrl()}\n";
} else {
    echo "Failed: {$result->error()}\n";
}

4. Multi-platform publishing

Publish to multiple platforms in a single call:

$results = $client->publish($post, [
    Platform::Telegram,
    Platform::Twitter,
    Platform::LinkedIn,
]);

foreach ($results as $result) {
    echo $result->isSuccessful()
        ? "{$result->platform()->value}: {$result->externalUrl()}\n"
        : "{$result->platform()->value}: {$result->error()}\n";
}

OwlStack formats your content for each platform automatically - character limits, markup syntax, hashtag placement, and media constraints are all handled server-side.

5. Add media

use OwlStack\Media;

$post = Post::create('Check out this photo!')
    ->withMedia(Media::image('/path/to/photo.jpg'))
    ->withHashtags(['photography']);

$client->publish($post, [Platform::Instagram, Platform::Twitter]);

OwlStack uploads and processes media on the server, resizing and converting as needed for each platform.

Next steps

On this page