{"id":23131202,"url":"https://github.com/emartech/session-validator-client-php","last_synced_at":"2025-07-06T00:03:27.173Z","repository":{"id":37444601,"uuid":"143260903","full_name":"emartech/session-validator-client-php","owner":"emartech","description":"PHP client for Emarsys session validator service","archived":false,"fork":false,"pushed_at":"2025-03-25T15:48:35.000Z","size":40,"stargazers_count":0,"open_issues_count":5,"forks_count":1,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-07-06T00:01:48.139Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emartech.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":"2018-08-02T07:48:07.000Z","updated_at":"2025-03-25T15:48:38.000Z","dependencies_parsed_at":"2025-04-08T13:53:38.171Z","dependency_job_id":"a840dc49-b327-4a1b-8504-c1624f93d49c","html_url":"https://github.com/emartech/session-validator-client-php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/emartech/session-validator-client-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fsession-validator-client-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fsession-validator-client-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fsession-validator-client-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fsession-validator-client-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emartech","download_url":"https://codeload.github.com/emartech/session-validator-client-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fsession-validator-client-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263826627,"owners_count":23516781,"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":[],"created_at":"2024-12-17T11:12:16.962Z","updated_at":"2025-07-06T00:03:27.112Z","avatar_url":"https://github.com/emartech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Session Validator Client PHP\n\nPHP client for Emarsys session validator service\n\n## Install\n\n```bash\ncomposer require emartech/session-validator-client\n```\n\n## Usage\n\n### Create client\n\nEscher example:\n```php\n$client = Client::create('https://session-validator.gservice.emarsys.net', 'escher_key', 'escher_secret');\n```\n\nmTLS example:\n```php\n$client = Client::create('http://session-validator-web.security');\n```\n\n### Check Session Validity\n\n`isValid` provides a function to validate user session using either a `msId` or a `sessionDataToken`.\n\n| Name               | Type     | Throws             | Description                                  |\n|--------------------|----------|--------------------|----------------------------------------------|\n| `msId`             | `string` | -                  | Deprecated and will be removed in the future |\n| `sessionDataToken` | `string` | `SessionDataError` |                                              |\n\n```php\nvar_dump($client-\u003eisValid('msid'));\n```\n\n```php\nvar_dump($client-\u003eisValid('session-data-token'));\n```\n\n### Batch validating multiple MSIDs\n\nReturns an array of the invalid MSIDs.\n\n\u003e Warning: The batch validation is deprecated and will be removed in the future.\n\n```php\nvar_dump($client-\u003efilterInvalid(['msid1', 'msid2']));\n```\n\n### Caching results\n\n```php\n$client = Client::create('https://session-validator.gservice.emarsys.net', 'escher_key', 'escher_secret');\n$cachedClient = CachedClient::create($client);\n\nvar_dump($cachedClient-\u003eisValid('msid')); // OR\nvar_dump($cachedClient-\u003eisValid('session-data-token'));\n```\n\n### Fetch session data\n\n`getSessionData` provides a function to fetch user session data object using a `sessionDataToken`.\n\n```php\nconst sessionData = $client-\u003egetSessionData('session-data-token');\n```\n\n### Logging\n\nTo enable logging, add a PSR-3 compatible logger to the client\n\n```php\nuse Monolog\\Logger;\n\n$client-\u003esetLogger(new Logger('name'));\n```\n\n### Local development\n\n```bash\nmake install\nmake test\nmake style\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femartech%2Fsession-validator-client-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femartech%2Fsession-validator-client-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femartech%2Fsession-validator-client-php/lists"}