{"id":18647744,"url":"https://github.com/andersundsehr/unleash","last_synced_at":"2026-01-27T02:33:56.637Z","repository":{"id":251509338,"uuid":"837628678","full_name":"andersundsehr/unleash","owner":"andersundsehr","description":"TYPO3 extension to integrate the getunleash.io feature toggle service.","archived":false,"fork":false,"pushed_at":"2024-11-07T08:30:39.000Z","size":213,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T18:30:38.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andersundsehr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-03T14:36:24.000Z","updated_at":"2024-11-25T11:23:07.000Z","dependencies_parsed_at":"2025-04-12T11:46:04.915Z","dependency_job_id":null,"html_url":"https://github.com/andersundsehr/unleash","commit_stats":null,"previous_names":["andersundsehr/unleash"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/andersundsehr/unleash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Funleash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Funleash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Funleash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Funleash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andersundsehr","download_url":"https://codeload.github.com/andersundsehr/unleash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Funleash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:27:44.304Z","updated_at":"2026-01-27T02:33:56.622Z","avatar_url":"https://github.com/andersundsehr.png","language":"PHP","readme":"# EXT:unleash\n\nTYPO3 extension to integrate the [Unleash](https://www.getunleash.io/) feature toggle service.\n\n## installation\n\n`composer require andersundsehr/unleash`\n\nSet configuration in the extension settings:\n\n## Configuration\n\nRequired are the `appUrl` and in most cases `authorization` (if you use the hosted unleash service)\n\n![Settings Panel](Documentation/settings.png \"Settings Panel\")\n\n\n## Usage\n\n### TypoScript Condition\n\nyou can use the custom TypoScript condition `unleash` to check if a feature is enabled.\n\n````ts\npage.19 = TEXT\npage.19.value = Feature 0 is disabled\u003cbr\u003e\n[unleash('feature0', false)]\n    page.19.value = Feature 0 is enabled\u003cbr\u003e\n[end]\n\npage.20 = TEXT\npage.20.value = Feature 1 is disabled\u003cbr\u003e\n[unleash('feature1')]\n    page.20.value = Feature 1 is enabled\u003cbr\u003e\n[end]\n\npage.21 = TEXT\npage.21.value = Feature 2 is disabled\u003cbr\u003e\n[unleash('feature2', true)]\n    page.21.value = Feature 2 is enabled\u003cbr\u003e\n[end]\n````\n\nif you want to check A/B/n flags, you can use the `unleashVariant` condition.\n\n````ts\npage.22 = TEXT\n[unleashVariant('feature3') === 'A']\n    page.22.value = Feature 3 is set to A enabled\u003cbr\u003e\n[end]\n[unleashVariant('feature3') === 'B']\n    page.22.value = Feature 3 is set to B enabled\u003cbr\u003e\n[end]\n[!unleashVariant('feature3')]\n    page.22.value = Feature 3 is disabled\u003cbr\u003e\n[end]\n````\n\n### Fluid ViewHelper\n\nif you want to check if a feature is enabled in your Fluid templates, you can use the `unleash:isEnabled` ViewHelper.\n\n````html\n{namespace unleash=Andersundsehr\\Unleash\\ViewHelpers}\n\n\u003cunleash:isEnabled feature=\"my-feature\" default=\"false\"\u003e\n    \u003cf:then\u003e\n        \u003cp\u003eFeature is enabled\u003c/p\u003e\n    \u003c/f:then\u003e\n    \u003cf:else\u003e\n        \u003cp\u003eFeature is disabled\u003c/p\u003e\n    \u003c/f:else\u003e\n\u003c/unleash:isEnabled\u003e\n\n{unleash:isEnabled(feature: 'my-feature', default: false, then: 'Feature is enabled', else: 'Feature is disabled')}\n````\n\nif you want to check A/B/n flags, you can use the `unleash:getVariant` ViewHelper.\n\n````html\n{namespace unleash=Andersundsehr\\Unleash\\ViewHelpers}\n\n\u003cf:switch expression=\"{unleash:getVariant(feature: 'my-feature')}\"\u003e\n    \u003cf:case value=\"A\"\u003e\u003cf:render section=\"A\"/\u003e\u003c/f:case\u003e\n    \u003cf:case value=\"B\"\u003e\u003cf:render section=\"B\"/\u003e\u003c/f:case\u003e\n    \u003cf:defaultCase\u003eIf is disabled\u003c/f:defaultCase\u003e\n\u003c/f:switch\u003e\n````\n\n\n### PHP\n\nyou can inject the `Unleash` service into your classes and use it like this:\n\nThe configuration and Context will already be set up for you.\n\nfor more detailed usage information, please refer to the [Unleash PHP SDK Documentation](https://docs.getunleash.io/reference/sdks/php)\n\n````php\nuse Unleash\\Client\\Unleash;\n\nclass Controller\n{\n    public function __construct(private Unleash $unleash) {}\n\n    public function index()\n    {\n        if ($this-\u003eunleash-\u003eisEnabled('my-feature')) {\n            // do something\n        }\n    }\n}\n````\n\nor you can use GeneralUtility to get the Unleash instance\n\n````php\nuse TYPO3\\CMS\\Core\\Utility\\GeneralUtility;\nuse Unleash\\Client\\Unleash;\n\nGeneralUtility::makeInstance(Unleash::class)-\u003eisEnabled('my-feature');\n````\n\n## CustomContext\n\nwith this extension you have the possiblity to constrain the feature toggles to specific users, or admins, or logged in users.  \nbackend and frontend:  \n\n- `backendUser.isLoggedIn`\n- `backendUser.id`\n- `backendUser.username`\n- `backendUser.isAdmin`\n- `frontendUser.isLoggedIn`\n- `frontendUser.id`\n- `frontendUser.username`\n- `frontendUser.isAdmin`\n\n## Extending with Events\n\nyou can extend the functionality of the Extension by using the following events.\n\n### UnleashBuilderBeforeBuildEvent\n\nEvent that is dispatched right before the UnleashBuilder is built (`-\u003ebuild()`).\n \n````php\nuse Andersundsehr\\Unleash\\Event\\UnleashBuilderBeforeBuildEvent;\n\nclass UnleashBuilderBeforeBuildEventListener\n{\n    public function __invoke(UnleashBuilderBeforeBuildEvent $event)\n    {\n        $event-\u003ebuilder = $event-\u003ebuilder\n            -\u003ewithAppName('my-custom-app-name');\n    }\n}\n````\n\n### UnleashCustomContextEvent\n\nThis event is dispatched when the Unleash context is created.  \nuse this if you only want to overwrite or add customContext data  \nif you want to change anything else, use the `UnleashContextCreatedEvent`\n\n````php\nuse Andersundsehr\\Unleash\\Event\\UnleashCustomContextEvent;\n\nclass UnleashCustomContextEventListener\n{\n    public function __invoke(UnleashCustomContextEvent $event)\n    {\n        $event-\u003ecustomContext['fair'] = 'value';\n    }\n}\n````\n\n### UnleashContextCreatedEvent\n\nEvent that is dispatched right after the UnleashContext is created with all the default values.  \nWill be called multiple times, once per `-\u003eisEnabled` or `-\u003egetVariant` call.\n\n````php\nuse Andersundsehr\\Unleash\\Event\\UnleashContextCreatedEvent;\n\nclass UnleashContextCreatedEventListener\n{\n    public function __invoke(UnleashContextCreatedEvent $event)\n    {\n        $event-\u003econtext-\u003esetHostname('my-custom-hostname');\n    }\n}\n````\n\n# with ♥️ from anders und sehr GmbH\n\n\u003e If something did not work 😮  \n\u003e or you appreciate this Extension 🥰 let us know.\n\n\u003e We are hiring https://www.andersundsehr.com/karriere/\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersundsehr%2Funleash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandersundsehr%2Funleash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersundsehr%2Funleash/lists"}