PHPackages                             seamapi/seam - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. seamapi/seam

ActiveLibrary[API Development](/categories/api)

seamapi/seam
============

v2.130.0(1mo ago)453.2k↑110.4%5[2 issues](https://github.com/seamapi/php/issues)PHPCI passing

Since Nov 8Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/seamapi/php)[ Packagist](https://packagist.org/packages/seamapi/seam)[ RSS](/packages/seamapi-seam/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (162)Used By (0)

Seam PHP SDK
============

[](#seam-php-sdk)

Control locks, lights and other internet of things devices with Seam's simple API.

Check out [the documentation](https://docs.seam.co) or the usage below.

Usage
-----

[](#usage)

```
$seam = new Seam\SeamClient("YOUR_API_KEY");

# Create a Connect Webview to login to a provider
$connect_webview = $seam->connect_webviews->create(
    accepted_providers: ["august"]
);

print "Please Login at this url: " . $connect_webview->url;

# Poll until connect webview is completed
while (true) {
    $connect_webview = $seam->connect_webviews->get(
        $connect_webview->connect_webview_id
    );
    if ($connect_webview->status == "authorized") {
        break;
    } else {
        sleep(1);
    }
}

$connected_account = $seam->connected_accounts->get(
    $connect_webview->connected_account_id
);

print "Looks like you connected with " .
    json_encode($connected_account->user_identifier);

$devices = $seam->devices->list(
    connected_account_id: $connected_account->connected_account_id
);

print "You have " . count($devices) . " devices";

$device_id = $devices[0]->device_id;

# Lock a Door
$seam->locks->lock_door($device_id);

$updated_device = $seam->devices->get($device_id);
$updated_device->properties->locked; // true

# Unlock a Door
$seam->locks->unlock_door($device_id);
$updated_device->properties->locked; // false

# Create an access code on a device
$access_code = $seam->access_codes->create(
    device_id: $device_id,
    code: "1234",
    name: "Test Code"
);

# Check the status of an access code
$access_code->status; // 'setting' (it will go to 'set' when active on the device)

$seam->access_codes->delete($access_code->access_code_id);
```

### Pagination

[](#pagination)

Some Seam API endpoints that return lists of resources support pagination. Use the `Paginator` class to fetch and process resources across multiple pages.

#### Manually fetch pages with the next\_page\_cursor

[](#manually-fetch-pages-with-the-next_page_cursor)

```
$pages = $seam->createPaginator(
    fn($params) => $seam->connected_accounts->list(...$params),
    ["limit" => 2]
);

[$connectedAccounts, $pagination] = $pages->firstPage();

if ($pagination->has_next_page) {
    [$moreConnectedAccounts] = $pages->nextPage($pagination->next_page_cursor);
}
```

#### Resume pagination

[](#resume-pagination)

Get the first page on initial load:

```
$params = ["limit" => 20];

$pages = $seam->createPaginator(
    fn($p) => $seam->connected_accounts->list(...$p),
    $params
);

[$connectedAccounts, $pagination] = $pages->firstPage();

// Store pagination state for later use
file_put_contents(
    "/tmp/seam_connected_accounts_list.json",
    json_encode([$params, $pagination])
);
```

Get the next page at a later time:

```
$stored_data = json_decode(
    file_get_contents("/tmp/seam_connected_accounts_list.json") ?: "[]",
    false
);

$params = $stored_data[0] ?? [];
$pagination =
    $stored_data[1] ??
    (object) ["has_next_page" => false, "next_page_cursor" => null];

if ($pagination->has_next_page) {
    $pages = $seam->createPaginator(
        fn($p) => $seam->connected_accounts->list(...$p),
        $params
    );
    [$moreConnectedAccounts] = $pages->nextPage($pagination->next_page_cursor);
}
```

#### Iterate over all resources

[](#iterate-over-all-resources)

```
$pages = $seam->createPaginator(
    fn($p) => $seam->connected_accounts->list(...$p),
    ["limit" => 20]
);

foreach ($pages->flatten() as $connectedAccount) {
    print $connectedAccount->account_type_display_name . "\n";
}
```

#### Return all resources across all pages as an array

[](#return-all-resources-across-all-pages-as-an-array)

```
$pages = $seam->createPaginator(
    fn($p) => $seam->connected_accounts->list(...$p),
    ["limit" => 20]
);

$connectedAccounts = $pages->flattenToArray();
```

Installation
------------

[](#installation)

To install the latest version of the automatically generated SDK, run:

`composer require seamapi/seam`

If you want to install our previous handwritten version, run:

`composer require seamapi/seam:1.1`

Development Setup
-----------------

[](#development-setup)

1. Run `yarn install` to get prettier installed for formatting
2. Install [composer](https://getcomposer.org/).
3. Run `composer install` in this directory
4. Run `composer exec phpunit tests`

> To run a specific test file, do `composer exec phpunit tests/MyTest.php`

### Running Tests

[](#running-tests)

You'll need to export `SEAM_API_KEY` to a sandbox workspace API key.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance79

Regular maintenance activity

Popularity38

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 50.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

140

Last Release

55d ago

Major Versions

v1.1.0 → v2.0.02024-01-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2afb8d7310fc0f120a33d96a0c06755ec0eba25b90a17d4a9cd58a594f87f1e?d=identicon)[seveibar](/maintainers/seveibar)

---

Top Contributors

[![seambot](https://avatars.githubusercontent.com/u/76183347?v=4)](https://github.com/seambot "seambot (267 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (124 commits)")[![andrii-balitskyi](https://avatars.githubusercontent.com/u/84702959?v=4)](https://github.com/andrii-balitskyi "andrii-balitskyi (56 commits)")[![seveibar](https://avatars.githubusercontent.com/u/1910070?v=4)](https://github.com/seveibar "seveibar (37 commits)")[![rchodava](https://avatars.githubusercontent.com/u/5033397?v=4)](https://github.com/rchodava "rchodava (22 commits)")[![razor-x](https://avatars.githubusercontent.com/u/721372?v=4)](https://github.com/razor-x "razor-x (9 commits)")[![itelo](https://avatars.githubusercontent.com/u/11433064?v=4)](https://github.com/itelo "itelo (3 commits)")[![sybohy](https://avatars.githubusercontent.com/u/852751?v=4)](https://github.com/sybohy "sybohy (2 commits)")[![codetheweb](https://avatars.githubusercontent.com/u/7410405?v=4)](https://github.com/codetheweb "codetheweb (2 commits)")[![DaniTulp](https://avatars.githubusercontent.com/u/18421761?v=4)](https://github.com/DaniTulp "DaniTulp (2 commits)")[![dawnho](https://avatars.githubusercontent.com/u/1843707?v=4)](https://github.com/dawnho "dawnho (2 commits)")[![klaco-smartbnb](https://avatars.githubusercontent.com/u/97881702?v=4)](https://github.com/klaco-smartbnb "klaco-smartbnb (2 commits)")[![panzerchris](https://avatars.githubusercontent.com/u/7239518?v=4)](https://github.com/panzerchris "panzerchris (1 commits)")[![abimaelmartell](https://avatars.githubusercontent.com/u/1450169?v=4)](https://github.com/abimaelmartell "abimaelmartell (1 commits)")

---

Tags

maintained

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/seamapi-seam/health.svg)

```
[![Health](https://phpackages.com/badges/seamapi-seam/health.svg)](https://phpackages.com/packages/seamapi-seam)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
