Download the PHP package marcostastny/sulu-ai-bundle without Composer
On this page you can find all versions of the php package marcostastny/sulu-ai-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marcostastny/sulu-ai-bundle
More information about marcostastny/sulu-ai-bundle
Files in marcostastny/sulu-ai-bundle
Package sulu-ai-bundle
Short Description AI-assisted SEO meta generation for Sulu
License MIT
Informations about the package sulu-ai-bundle
SuluAIBundle
AI-assisted SEO meta generation for Sulu 3.
- A Settings page (Settings → AI Settings) to configure an OpenAI-compatible API (base URL, model, API key, enabled toggle).
- A Generate meta with AI button on a page's Meta / SEO tab that sends the saved page's content to the API and fills the meta title, description and keywords.
Requirements
- PHP >= 8.2
- Sulu >= 3.0
- Symfony >= 6.4
Installation
Register the bundle in config/bundles.php:
Import the admin API routes in config/routes_admin.yaml:
Update the schema (Sulu uses the admin kernel):
Import the admin JS in your assets/admin/index.js (or app.js) and rebuild:
Permissions
The bundle registers two security contexts under Settings → Roles, so you can let content editors generate meta without giving them access to the API key:
| Section | Context | Grants |
|---|---|---|
| AI Settings | sulu_ai.settings |
View/Edit the settings page (API URL, key, model) |
| AI Meta Generation | sulu_ai.meta_generation |
View to show and use the Generate meta with AI button on pages |
Grant the relevant permissions to each role under Settings → Roles. The generate-meta button only appears for users who have View on AI Meta Generation, and the endpoint enforces the same permission.
Usage
- Open Settings → AI Settings, enter the API URL (e.g.
https://api.openai.com/v1), model (e.g.gpt-4o-mini) and API key, toggle Enabled, and save. - Open a page, save it, then open its Meta / SEO tab.
- Click Generate meta with AI. The title, description and keywords fields are filled from the page's content (in the current content language). Review and save.
The button is disabled until the page has been saved at least once (the backend reads the saved page content).
How it works
The button posts the page id + locale to POST /admin/api/ai/generate-meta. The
controller loads the saved page server-side (PageRepositoryInterface +
ContentManagerInterface), flattens its content to plain text, calls the
configured chat-completions endpoint, and returns {title, description, keywords} which the button writes into the SEO fields. The API key never leaves
the server.
All versions of sulu-ai-bundle with dependencies
sulu/sulu Version ^3.0
symfony/config Version ^6.4 || ^7.0
symfony/dependency-injection Version ^6.4 || ^7.0
symfony/framework-bundle Version ^6.4 || ^7.0
symfony/http-client Version ^6.4 || ^7.0
symfony/http-foundation Version ^6.4 || ^7.0
symfony/http-kernel Version ^6.4 || ^7.0