Google Cloud IoT Core for PHP

Idiomatic PHP client forGoogle Cloud IoT Core.

Latest Stable VersionPackagist

NOTE: This repository is part ofGoogle Cloud PHP. Anysupport requests, bug reports, or development contributions should be directed tothat project.

A fully managed service for securely connecting and managing IoT devices, from a few to millions. Ingest data fromconnected devices and build rich applications that integrate with the other big data services of Google Cloud Platform.

Installation

To begin, install the preferred dependency manager for PHP,Composer.

Now install this component:

$ composer require google/cloud-iot

Authentication

Please see ourAuthentication guide for more informationon authenticating your client. Once authenticated, you'll be ready to start making requests.

Sample

require 'vendor/autoload.php';use Google\Cloud\Iot\V1\DeviceManagerClient;$deviceManager = new DeviceManagerClient();$projectId = '[MY_PROJECT_ID]';$location = 'us-central1';$registryId = '[MY_REGISTRY_ID]';$registryName = $deviceManager->registryName($projectId, $location, $registryId);$devices = $deviceManager->listDevices($registryName);foreach ($devices->iterateAllElements() as $device) {    printf('Device: %s : %s' . PHP_EOL,        $device->getNumId(),        $device->getId()    );}

Version

This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes inany minor or patch releases. We will address issues and requests with the highest priority.

Next Steps

  1. Understand theofficial documentation.
  2. Take a look atin-depth usage samples.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.