{"id":23376225,"url":"https://github.com/trustedshops-public/cot-php-integration-library","last_synced_at":"2025-04-10T18:42:41.028Z","repository":{"id":247378718,"uuid":"823654903","full_name":"trustedshops-public/cot-php-integration-library","owner":"trustedshops-public","description":"A PHP integration library for connecting to Community of Trust platform.","archived":false,"fork":false,"pushed_at":"2025-04-09T19:59:32.000Z","size":118,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T20:43:55.553Z","etag":null,"topics":["integration","trustedshops","tslibraries"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trustedshops-public.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-03T12:56:58.000Z","updated_at":"2025-03-25T14:16:18.000Z","dependencies_parsed_at":"2024-07-19T14:22:33.129Z","dependency_job_id":"b2b6f254-bcaa-4a48-b524-621271527238","html_url":"https://github.com/trustedshops-public/cot-php-integration-library","commit_stats":null,"previous_names":["trustedshops-public/cot-php-integration-library"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fcot-php-integration-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fcot-php-integration-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fcot-php-integration-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fcot-php-integration-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trustedshops-public","download_url":"https://codeload.github.com/trustedshops-public/cot-php-integration-library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271910,"owners_count":21075800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["integration","trustedshops","tslibraries"],"created_at":"2024-12-21T17:34:51.700Z","updated_at":"2025-04-10T18:42:41.011Z","avatar_url":"https://github.com/trustedshops-public.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Community of Trust PHP Integration Library\n\n![License](https://img.shields.io/github/license/trustedshops-public/cot-php-integration-library)\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/trustedshops-public/cot-php-integration-library/tree/main.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/trustedshops-public/cot-php-integration-library/tree/main)\n\nThis library provides a comprehensive PHP interface for integrating with the Community of Trust (COT) platform, facilitating seamless interactions with its services.\n\n## Requirements\n\n- PHP \u003e= 7.4\n- Composer for managing dependencies\n\n## Installation\n\nTo install the library, run the following command in your project directory:\n\n```sh\ncomposer require trstd/cot-integration-library\n```\n\n## Usage\n\nHere is a basic example of how to use the library:\n\nOn the backend side:\n\n```php\n\u003c?php\n\nrequire_once 'vendor/autoload.php';\n\nuse TRSTD\\COT\\Client;\n\n// Initialize the client\n$client = new Client(\n    \u003cTSID\u003e, // Trusted Shops ID - e.g. 'X1234567890123456789012345678901'\n    \u003cCLIENT_ID\u003e, // Client ID - e.g. 'cot-switch-X1234567890123456789012345678901'\n    \u003cCLIENT_SECRET\u003e, // Client Secret - e.g. '1234567890123456789012345678901234567890123456789012345678901234'\n    \u003cAUTH_STORAGE_INSTANCE\u003e, // It can be any storage option implementing AuthStorageInterface - e.g. new DatabaseAuthStorage()\n    \u003cENV\u003e // Environment (optional) - dev, qa, or prod, defaults to prod\n);\n\n// Invoke handleCallback function to handle code coming from the authentication server\n$client-\u003ehandleCallback();\n\n// Get anonymous consumer data for the current user\n$client-\u003egetAnonymousConsumerData();\n```\n\nOn the frontend side, place the following code in your HTML file where you want the widget to appear:\n\n```html\n\u003ctrstd-switch tsId=\"X1234567890123456789012345678901\"\u003e\u003c/trstd-switch\u003e\n\u003cscript type=\"module\" src=\"https://widgets.trustedshops.com/switch/switch.js\"\u003e\u003c/script\u003e\n```\n\nFor more detailed examples, please refer to the [`examples/`](./examples/) directory.\n\n## Contributing\n\nContributions are welcome! Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines.\n\n## License\n\nThis library is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- [firebase/php-jwt](https://github.com/firebase/php-jwt) for JWT handling\n- [phpseclib/phpseclib](https://github.com/phpseclib/phpseclib) for security features\n- [monolog/monolog](https://github.com/Seldaek/monolog) for logging\n- [phpfastcache/phpfastcache](https://github.com/PHPSocialNetwork/phpfastcache) for caching solutions\n- [symfony/http-client](https://github.com/symfony/http-client) for HTTP client features\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](https://semver.org/). For the versions available, see the [tags on this repository](\n    https://github.com/trustedshops-public/cot-php-integration-library/tags\n).\n\n## PHP Package Repository\n\nThis library is available on [Packagist](https://packagist.org/packages/trstd/cot-integration-library).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustedshops-public%2Fcot-php-integration-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrustedshops-public%2Fcot-php-integration-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustedshops-public%2Fcot-php-integration-library/lists"}