{"id":24764486,"url":"https://github.com/seamapi/php","last_synced_at":"2026-04-22T05:05:43.211Z","repository":{"id":59285693,"uuid":"535788749","full_name":"seamapi/php","owner":"seamapi","description":"PHP SDK for using Seam Connect to control door locks and other IoT devices","archived":false,"fork":false,"pushed_at":"2026-04-03T03:44:40.000Z","size":1083,"stargazers_count":4,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-04-03T12:37:06.848Z","etag":null,"topics":["maintained"],"latest_commit_sha":null,"homepage":"","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/seamapi.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-12T17:59:00.000Z","updated_at":"2026-04-03T03:44:43.000Z","dependencies_parsed_at":"2023-10-11T20:55:55.936Z","dependency_job_id":"a1592096-7346-440a-8e96-b08941af4c68","html_url":"https://github.com/seamapi/php","commit_stats":{"total_commits":60,"total_committers":9,"mean_commits":6.666666666666667,"dds":0.6666666666666667,"last_synced_commit":"370e884284864599aff851ca2378f1258fa73196"},"previous_names":[],"tags_count":143,"template":false,"template_full_name":null,"purl":"pkg:github/seamapi/php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seamapi","download_url":"https://codeload.github.com/seamapi/php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seamapi%2Fphp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31540826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"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":["maintained"],"created_at":"2025-01-28T22:31:41.746Z","updated_at":"2026-04-08T05:02:01.170Z","avatar_url":"https://github.com/seamapi.png","language":"PHP","readme":"# Seam PHP SDK\n\nControl locks, lights and other internet of things devices with Seam's simple API.\n\nCheck out [the documentation](https://docs.seam.co) or the usage below.\n\n## Usage\n\n```php\n$seam = new Seam\\SeamClient(\"YOUR_API_KEY\");\n\n# Create a Connect Webview to login to a provider\n$connect_webview = $seam-\u003econnect_webviews-\u003ecreate(\n    accepted_providers: [\"august\"]\n);\n\nprint \"Please Login at this url: \" . $connect_webview-\u003eurl;\n\n# Poll until connect webview is completed\nwhile (true) {\n    $connect_webview = $seam-\u003econnect_webviews-\u003eget(\n        $connect_webview-\u003econnect_webview_id\n    );\n    if ($connect_webview-\u003estatus == \"authorized\") {\n        break;\n    } else {\n        sleep(1);\n    }\n}\n\n$connected_account = $seam-\u003econnected_accounts-\u003eget(\n    $connect_webview-\u003econnected_account_id\n);\n\nprint \"Looks like you connected with \" .\n    json_encode($connected_account-\u003euser_identifier);\n\n$devices = $seam-\u003edevices-\u003elist(\n    connected_account_id: $connected_account-\u003econnected_account_id\n);\n\nprint \"You have \" . count($devices) . \" devices\";\n\n$device_id = $devices[0]-\u003edevice_id;\n\n# Lock a Door\n$seam-\u003elocks-\u003elock_door($device_id);\n\n$updated_device = $seam-\u003edevices-\u003eget($device_id);\n$updated_device-\u003eproperties-\u003elocked; // true\n\n# Unlock a Door\n$seam-\u003elocks-\u003eunlock_door($device_id);\n$updated_device-\u003eproperties-\u003elocked; // false\n\n# Create an access code on a device\n$access_code = $seam-\u003eaccess_codes-\u003ecreate(\n    device_id: $device_id,\n    code: \"1234\",\n    name: \"Test Code\"\n);\n\n# Check the status of an access code\n$access_code-\u003estatus; // 'setting' (it will go to 'set' when active on the device)\n\n$seam-\u003eaccess_codes-\u003edelete($access_code-\u003eaccess_code_id);\n```\n\n### Pagination\n\nSome Seam API endpoints that return lists of resources support pagination.\nUse the `Paginator` class to fetch and process resources across multiple pages.\n\n#### Manually fetch pages with the next_page_cursor\n\n```php\n$pages = $seam-\u003ecreatePaginator(\n    fn($params) =\u003e $seam-\u003econnected_accounts-\u003elist(...$params),\n    [\"limit\" =\u003e 2]\n);\n\n[$connectedAccounts, $pagination] = $pages-\u003efirstPage();\n\nif ($pagination-\u003ehas_next_page) {\n    [$moreConnectedAccounts] = $pages-\u003enextPage($pagination-\u003enext_page_cursor);\n}\n```\n\n#### Resume pagination\n\nGet the first page on initial load:\n\n```php\n$params = [\"limit\" =\u003e 20];\n\n$pages = $seam-\u003ecreatePaginator(\n    fn($p) =\u003e $seam-\u003econnected_accounts-\u003elist(...$p),\n    $params\n);\n\n[$connectedAccounts, $pagination] = $pages-\u003efirstPage();\n\n// Store pagination state for later use\nfile_put_contents(\n    \"/tmp/seam_connected_accounts_list.json\",\n    json_encode([$params, $pagination])\n);\n```\n\nGet the next page at a later time:\n\n```php\n$stored_data = json_decode(\n    file_get_contents(\"/tmp/seam_connected_accounts_list.json\") ?: \"[]\",\n    false\n);\n\n$params = $stored_data[0] ?? [];\n$pagination =\n    $stored_data[1] ??\n    (object) [\"has_next_page\" =\u003e false, \"next_page_cursor\" =\u003e null];\n\nif ($pagination-\u003ehas_next_page) {\n    $pages = $seam-\u003ecreatePaginator(\n        fn($p) =\u003e $seam-\u003econnected_accounts-\u003elist(...$p),\n        $params\n    );\n    [$moreConnectedAccounts] = $pages-\u003enextPage($pagination-\u003enext_page_cursor);\n}\n```\n\n#### Iterate over all resources\n\n```php\n$pages = $seam-\u003ecreatePaginator(\n    fn($p) =\u003e $seam-\u003econnected_accounts-\u003elist(...$p),\n    [\"limit\" =\u003e 20]\n);\n\nforeach ($pages-\u003eflatten() as $connectedAccount) {\n    print $connectedAccount-\u003eaccount_type_display_name . \"\\n\";\n}\n```\n\n#### Return all resources across all pages as an array\n\n```php\n$pages = $seam-\u003ecreatePaginator(\n    fn($p) =\u003e $seam-\u003econnected_accounts-\u003elist(...$p),\n    [\"limit\" =\u003e 20]\n);\n\n$connectedAccounts = $pages-\u003eflattenToArray();\n```\n\n## Installation\n\nTo install the latest version of the automatically generated SDK, run:\n\n`composer require seamapi/seam`\n\nIf you want to install our previous handwritten version, run:\n\n`composer require seamapi/seam:1.1`\n\n## Development Setup\n\n1. Run `yarn install` to get prettier installed for formatting\n2. Install [composer](https://getcomposer.org/).\n3. Run `composer install` in this directory\n4. Run `composer exec phpunit tests`\n\n\u003e To run a specific test file, do `composer exec phpunit tests/MyTest.php`\n\n### Running Tests\n\nYou'll need to export `SEAM_API_KEY` to a sandbox workspace API key.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseamapi%2Fphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseamapi%2Fphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseamapi%2Fphp/lists"}