{"id":15068564,"url":"https://github.com/journy-io/php-sdk","last_synced_at":"2025-04-10T17:51:22.310Z","repository":{"id":47473919,"uuid":"278296237","full_name":"journy-io/php-sdk","owner":"journy-io","description":"🐘 The official PHP SDK that you can use to easily interact with our API","archived":false,"fork":false,"pushed_at":"2023-10-13T18:07:27.000Z","size":561,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T15:41:31.362Z","etag":null,"topics":["php","php7","php8","sdk","sdk-php"],"latest_commit_sha":null,"homepage":"https://developers.journy.io","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/journy-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-07-09T07:36:59.000Z","updated_at":"2022-02-12T13:56:00.000Z","dependencies_parsed_at":"2024-10-13T04:41:20.524Z","dependency_job_id":"fa622f9b-6b3a-4bb3-9ea6-ed608fbfa739","html_url":"https://github.com/journy-io/php-sdk","commit_stats":{"total_commits":82,"total_committers":4,"mean_commits":20.5,"dds":"0.36585365853658536","last_synced_commit":"5e510cd22deb5be66b0a5abd1d656d359747b2c6"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fphp-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fphp-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fphp-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fphp-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/journy-io","download_url":"https://codeload.github.com/journy-io/php-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262433,"owners_count":21074308,"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":["php","php7","php8","sdk","sdk-php"],"created_at":"2024-09-25T01:38:06.363Z","updated_at":"2025-04-10T17:51:22.291Z","avatar_url":"https://github.com/journy-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![journy.io](banner.png)](https://journy.io/?utm_source=github\u0026utm_content=readme-php-sdk)\n\n# journy.io PHP SDK\n\n[![Latest version on Packagist](https://img.shields.io/packagist/v/journy-io/sdk?color=%234d84f5\u0026style=flat-square)](https://packagist.org/packages/journy-io/sdk)\n[![Downloads](https://img.shields.io/packagist/dt/journy-io/sdk?color=%234d84f5\u0026style=flat-square)](https://packagist.org/packages/journy-io/sdk)\n[![Supported PHP versions](https://img.shields.io/packagist/php-v/journy-io/sdk?color=%234d84f5\u0026style=flat-square)](https://packagist.org/packages/journy-io/sdk)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\nThis is the official PHP SDK for [journy.io](https://journy.io?utm_source=github\u0026utm_content=readme-php-sdk).\n\n## 💾 Installation\n\nYou can use composer to install the SDK:\n\n```bash\ncomposer require journy-io/sdk\n```\n\nYou will also need a PSR-7 implementation (HTTP messages), PSR-17 implementation (HTTP factory) and PSR-18 implementation (HTTP client).\n\nIf your app doesn't have these yet installed, we recommend:\n\n```bash\ncomposer require kriswallsmith/buzz nyholm/psr7\n```\n\n-   [https://github.com/kriswallsmith/Buzz](https://github.com/kriswallsmith/Buzz)\n-   [https://github.com/Nyholm/psr7](https://github.com/Nyholm/psr7)\n\n## 🔌 Getting started\n\n### Configuration\n\nTo be able to use the SDK you need to generate an API key. If you don't have one you can create one in [journy.io](https://system.journy.io?utm_source=github\u0026utm_content=readme-php-sdk).\n\nIf you don't have an account yet, you can create one in [journy.io](https://system.journy.io/register?utm_source=github\u0026utm_content=readme-php-sdk) or [request a demo first](https://www.journy.io/book-demo?utm_source=github\u0026utm_content=readme-php-sdk).\n\nGo to your settings, under the _Connections_-tab, to create and edit API keys. Make sure to give the correct permissions to the API Key.\n\n```php\nuse JournyIO\\SDK\\Client;\n\n// composer require kriswallsmith/buzz nyholm/psr7\n$client = Client::withDefaults(\"your-api-key\");\n```\n\nIf you want to use your own HTTP client (PSR-18):\n\n```php\nuse Buzz\\Client\\Curl;\nuse JournyIO\\SDK\\Client;\nuse Nyholm\\Psr7\\Factory\\Psr17Factory;\n\n// https://github.com/Nyholm/psr7\n$factory = new Psr17Factory();\n\n// https://github.com/kriswallsmith/Buzz\n$http = new Curl($factory, [\"timeout\" =\u003e 5]);\n\n$client = new Client($http, $factory, $factory, [\"apiKey\" =\u003e \"your-api-key\"]);\n```\n\n### Methods\n\n#### Get API key details\n\n```php\nuse JournyIO\\SDK\\ApiKeyDetails;\n\n$call = $client-\u003egetApiKeyDetails();\n\nif ($call-\u003esucceeded()) {\n    $result = $call-\u003eresult();\n\n    if ($result instanceof ApiKeyDetails) {\n        var_dump($result-\u003egetPermissions()); // string[]\n    }\n} else {\n    var_dump($call-\u003eerrors());\n}\n```\n\n### Handling errors\n\nEvery call will return a result, we don't throw errors when a call fails. We don't want to break your application when things go wrong. An exception will be thrown for required arguments that are empty or missing.\n\n```php\n$call = $client-\u003egetTrackingSnippet(\"blog.acme.com\");\n\nvar_dump($call-\u003esucceeded()); // bool\nvar_dump($call-\u003erateLimited()); // bool\nvar_dump($call-\u003eremainingRequests()); // int\nvar_dump($call-\u003emaxRequests()); // int\nvar_dump($call-\u003eerrors()); // array\n```\n\n## 📬 API Docs\n\n[API reference](https://developers.journy.io)\n\n## 💯 Tests\n\nTo run the tests:\n\n```bash\ncomposer run test\n```\n\n## ❓ Help\n\nWe welcome your feedback, ideas and suggestions. We really want to make your life easier, so if we’re falling short or should be doing something different, we want to hear about it.\n\nPlease create an issue or contact us via the chat on our website.\n\n## 🔒 Security\n\nIf you discover any security related issues, please email security at journy io instead of using the issue tracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjourny-io%2Fphp-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjourny-io%2Fphp-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjourny-io%2Fphp-sdk/lists"}