survos/sais-bundle

Integration with Survos Async Image Server

Fund package maintenance!
kbond

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.5.442 2024-12-09 13:12 UTC

README

A simple bundle that facilitates calling the Survos Async Image Service from an application

composer require survos/sais-bundle

@todo: Get an API key at https://sais.survos.com and add it to your .env.local

# .env.local
SAIS_API_KEY=your-api-key

Calls

Inject the service and make the calls

    @todo: command that sends batches of images
    #[Route('/featured', name: 'app_list_featured_projects')]
    public function listFeatured(SaisClientService $saisService): Response
    {
        $payload = new \Survos\SaisBundle\Model\ProcessPayload(
            $images,
            ['small'],
            $this->urlGenerator->generate('app_webhook')
        );
        $saisService->dispatchProcess($payload);
    }

    #[Route('/webhook', name: 'app_webhook')]
    public function webHook(): Response
    {
        $data = ...
    }