PHPackages                             communitychair1/hv-client-lib - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. communitychair1/hv-client-lib

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

communitychair1/hv-client-lib
=============================

Easy to use lightweight PHP library to connect to Microsoft HealthVault.

1.2.1(13y ago)03871GPL-2.0+PHP

Since Apr 8Pushed 12y ago9 watchersCompare

[ Source](https://github.com/communitychair1/HVClientLibPHP)[ Packagist](https://packagist.org/packages/communitychair1/hv-client-lib)[ Docs](https://github.com/mkalkbrenner/HVClientLibPHP)[ RSS](/packages/communitychair1-hv-client-lib/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

HVClientLibPHP [![Build Status](https://camo.githubusercontent.com/5ab89c4fa94fc51f69cae2c09e006437403ccda3b5ca184f99c075e7999b9f0d/68747470733a2f2f7472617669732d63692e6f72672f636f6d6d756e6974796368616972312f4856436c69656e744c69625048502e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/communitychair1/HVClientLibPHP)
========================================================================================================================================================================================================================================================================================================================================

[](#hvclientlibphp-)

An easy to use PHP library to connect to [Microsoft® HealthVault™](https://www.healthvault.com/)on top of [HVRawConnectorPHP](https://github.com/communitychair1/HVRawConnectorPHP). It adds a nicer object oriented programming interface and hides (most) of the complicated XML parts in the HealthVault protocol.

This library was forked from [HVClientPHP](https://github.com/mkalkbrenner/HVClientLibPHP) and many new features have been created and added to the library. A list of changes is at the bottom of this document.

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

[](#installation)

HVClientLibPHP depends on [HVRawConnectorPHP](https://github.com/communitychair1/HVRawConnectorPHP).

You can simply use composer to install HVRawConnectorPHP and it's dependencies.

To add HVClientLibPHP as a library in your project, add something like that to the 'require' section of your `composer.json`:

```
{
  "require": {
    "communitychair1/hv-client-lib": "dev-master"
  }
}
```

If composer complains about an unknown pear channel, add this to your `composer.json`:

```
{
  "repositories": [
    {
      "type": "pear",
      "url": "http://pear.php.net"
    }
  ]
}
```

Earlier version of HVClientLibPHP could also be installed by pear including all it's dependencies:

```
pear channel-discover pear.biologis.com
pear channel-discover pear.querypath.org
pear install biologis/HVClient

```

This method will install HVClientLibPHP as a library, but without the available demo application.

Status
------

[](#status)

HVClientLibPHP is not a full featured HealthVault SDK, but should provide all the required stuff to create powerful HealthVault applications with PHP.

It can basically handle all [Things](http://developer.healthvault.com/pages/types/types.aspx) already, but over the time we will add some more convenience function to the representing classes.

But the number of implemented [Methods](http://developer.healthvault.com/pages/methods/methods.aspx) is very limited at the moment (the essential ones are available):

- GetPersonInfo
- GetThings
- PutThings

If you need more and understand the available [Documentation](http://developer.healthvault.com/default.aspx), you can always use HVRawConnectorPHP directly. In that case you should ideally contribute your work to let HVClientLibPHP grow faster.

Usage
-----

[](#usage)

This is a simple example to display all weight measurements:

```
$hv = new HVClient($yourAppId, $_SESSION);
$hv->connect($yourCertThumbPrint, $yourPrivateKey);

$personInfo = $hv->getPersonInfo();
$recordId = $personInfo->selected_record_id;

$things = $hv->getThings('Weight Measurement', $recordId);
foreach ($things as $thing) {
  print $thing->weight->value->kg;
}
```

Connect a different HealthVault™ instance using a different country and language:

```
$hv = new HVClient($yourAppId, $_SESSION);

$hv->setHealthVaultPlatform(
  'https://platform.healthvault-ppe.co.uk/platform/wildcat.ashx');
$hv->setLanguage('de');
$hv->setCountry('DE');

$hv->connect($yourCertThumbPrint, $yourPrivateKey);
```

To connect your PHP based HealthVault™ app, your app needs to authorized by the user and the user himself needs to be authenticated against HealthVault™. If any of these requirements are not met, HVClientLibPHP throws corresponding exceptions. In this case you can create a link that takes the user to HealthVault™ to authenticate himself and to authorize your app and takes him back to your site afterwards:

```
$hv = new HVClient($yourAppId, $_SESSION);

try {
  $hv->connect($yourCertThumbPrint, $yourPrivateKey);
  $personInfo = $hv->getPersonInfo();
}
catch (HVRawConnectorUserNotAuthenticatedException $e) {
 print 'Authenticate';
}
```

For more examples have a look at the demo\_app source code included in HVClientLibPHP.

The HVClientLibPHP will never provide an API to register a new HealthVault™ app or to guide you through the on-boarding process, because this could be easily done using the [Application Configuration Center](http://config.healthvault-ppe.com/).

So register your app there first and start coding afterwards.

The demo\_app (aka Hello World) is already registered. For your first tests you can also use it's credentials to start right away.

Demo
----

[](#demo)

The demo\_app included in this repository currently demonstrates two features:

- It queries a user's HealthVault record for all "[Things](http://developer.healthvault.com/pages/types/types.aspx)" and dumps the raw XML content.
- It lists all files uploaded to your selected health record and lets you upload additional files.

By default it uses the US pre production instance of HealthVault.

To get started, follow the install instructions above and put the demo\_app folder on a web server and access "demo\_app/index.php".

Changes And Additions
---------------------

[](#changes-and-additions)

- Several things types have been added to the library, such as emotional state, sleep session, sleep related activity, and health journal entry.
- Helper methods have been created to export health vault thing types as JSON and to facilitate creation of various thing types.
- The HV Connect function has been updated to support both online and offline connection modes.
- The Get Things function has been updated to support putting of pictures and files
- Unit tests have been created to test all of this functionality and some of the functionality of the original library.

Licence
-------

[](#licence)

[GPLv2](https://raw.github.com/communitychair1/HVClientLibPHP/master/LICENSE.txt).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~23 days

Total

2

Last Release

4807d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4604275?v=4)[communitychair1](/maintainers/communitychair1)[@communitychair1](https://github.com/communitychair1)

---

Top Contributors

[![troussos](https://avatars.githubusercontent.com/u/1744354?v=4)](https://github.com/troussos "troussos (72 commits)")[![CostelloNicho](https://avatars.githubusercontent.com/u/1738058?v=4)](https://github.com/CostelloNicho "CostelloNicho (43 commits)")[![ofields](https://avatars.githubusercontent.com/u/4315747?v=4)](https://github.com/ofields "ofields (32 commits)")[![communitychair1](https://avatars.githubusercontent.com/u/4604275?v=4)](https://github.com/communitychair1 "communitychair1 (23 commits)")[![ecompton3](https://avatars.githubusercontent.com/u/1847353?v=4)](https://github.com/ecompton3 "ecompton3 (1 commits)")[![matei1987](https://avatars.githubusercontent.com/u/2926287?v=4)](https://github.com/matei1987 "matei1987 (1 commits)")

---

Tags

xmlhealthvault

### Embed Badge

![Health badge](/badges/communitychair1-hv-client-lib/health.svg)

```
[![Health](https://phpackages.com/badges/communitychair1-hv-client-lib/health.svg)](https://phpackages.com/packages/communitychair1-hv-client-lib)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

186545.9k2](/packages/wikimedia-parsoid)[goetas-webservices/xsd2php

Convert XSD (XML Schema) definitions into PHP classes and JMS metadata

2391.7M43](/packages/goetas-webservices-xsd2php)[amabnl/amadeus-ws-client

SOAP Web Service client library for interacting with the Amadeus GDS through its SOAP interface

207261.5k](/packages/amabnl-amadeus-ws-client)[symfony/json-streamer

Provides powerful methods to read/write data structures from/into JSON streams.

17569.5k27](/packages/symfony-json-streamer)[friendsofcxml/cxml-php

PHP Implementation of cXML Standard

16131.4k7](/packages/friendsofcxml-cxml-php)

PHPackages © 2026

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