PHPackages                             graphcomment/sdk-api-php - 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. graphcomment/sdk-api-php

ActiveLibrary[API Development](/categories/api)

graphcomment/sdk-api-php
========================

PHP wrapper for the GraphComment API

v3.1.0(2w ago)62931MITPHPPHP ^8.1CI failing

Since Apr 24Pushed 6y ago2 watchersCompare

[ Source](https://github.com/graphcomment/sdk-api-php)[ Packagist](https://packagist.org/packages/graphcomment/sdk-api-php)[ Docs](https://github.com/graphcomment/sdk-api-php)[ RSS](/packages/graphcomment-sdk-api-php/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (24)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b1005e229c4de5bdd86ef1f5caf79c99996c05ac85475664b7bbb4523c0e65c9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6772617068636f6d6d656e742f73646b2d6170692d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/graphcomment/sdk-api-php/?branch=master)[![Build Status](https://camo.githubusercontent.com/235d34ddae7bb5a1695769448bbed82a66e59a2534dbccbd4cc1a267b5a85ecf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6772617068636f6d6d656e742f73646b2d6170692d7068702f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/graphcomment/sdk-api-php/build-status/master)

\#Graphcomment SDK API PHP version 2.3.2

install with composer :

`composer require graphcomment/sdk-api-php`

- The Wrapper use the last version of Guzzle.
- To use the PHP Wrapper you must create an account on Graphcomment.com and subscribe a paid plan.

With this wrapper you will be able to :

- Register automatically a new User on GraphComment whenever he subscribe on your website.
- Connect a user to GraphComment when he logs in to your website.
- Get the user information saved in graphcomment.
- Update the user information from your system to graphcomment.
- Get the count of comments active on a thread.

Example of implementation :

`$client = new Sdk(GC_PUBLIC_KEY, GC_SECRET_KEY);`

after theses lines, you call the functions.

- register a User

`$client->registerUser('username', 'email', 'fr', 'https://graphcomment.com/image.jpg');`

This function return a json file containing its "gc\_id" that must be save in your database to authenticate a user that is logging in and do\_sync date of synchronisation to save too.

- login a User, this function return the token JWT as JSON that you must save in localStorage to authenticate Graphcomment.

`$client->loginUser('gc_id');`

to save in localStorage the gc\_token, call this url in an iframe with 0px width, 0px width of user to authenticate him =&gt; [https://graphcomment.com/fr/auth.html?gc\_token=\[TOKEN-without-JWT-only-token\]](https://graphcomment.com/fr/auth.html?gc_token=%5BTOKEN-without-JWT-only-token%5D)

to destroy session localStorage, call this url in an iframe with 0px width, 0px width of user =&gt;

Example :

Connexion :

``

Disconnection :

``

- Get last informations from a user

`$client->getUser('gc_id');`

get user's informations, return a JSON.

```
{
	gc_id: 'gc_id',
	username: 'username',
	email: 'email@email.com',
	language : 'en',
	picture : 'https://graphcomment.com/image.jpg',
	do_sync : date of synchronisation
}

```

- Update a User on Graphcomment

`$client->updateUser('gc_id', 'username', 'email', 'fr', 'https://graphcomment.com/image.jpg');`

return do\_sync date and gc\_id with state 'updated'

- Count Comments of a thread

`$client->countCommentscountComments('https://graphcomment.com/thread.html', 'content123');`

- Export Comments to synchronise with your databases

This query is limited by 100 comments for each query.

`$client->exportComments();`

list 100 comments in json array :

```
{
    comments : [
     {
         "cached_author": {
           "username": "gc",
           "email": "grdnlndn@gmail.com"
         },
         "guest": false,
         "status": "approved",
         "spam": false,
         "_id": "5cb0621843647e1332eba194",
         "content": "test from GC 7",
         "thread": {
           "_id": "5c790ace3f227b1ac45a29b7",
           "url": "http://localhost:8080/?p=5",
           "page_title": "Article with GC",
           "guid": "http://localhost:8080/?p=5",
           "uid": "5"
         },
         "author": {
           "profiles": [
             {
               "language": "fr",
               "_id": "5c790acd3f227b1ac45a29b6",
               "username": "gc",
               "email": "grdnlndn@gmail.com",
               "uid": "1"
             }
           ],
           "_id": "59c0cd87740e0704dba1cf6b"
         },
         "ip": "176.164.57.27",
         "edited_at": "2019-04-12T10:02:00.376Z",
         "created_at": "2019-04-12T10:02:00.343Z"
       },
       {
           "cached_author": {
             "username": "gc",
             "email": "grdnlndn@gmail.com"
           },
           "guest": false,
           "status": "deleted",
           "spam": false,
           "_id": "5cb0621843647e1332eba194",
           "content": "test from GC 7",
           "thread": {
             "_id": "5c790ace3f227b1ac45a29b7",
             "url": "http://localhost:8080/?p=5",
             "page_title": "Article with GC",
             "guid": "http://localhost:8080/?p=5",
             "uid": "5"
           },
           "author": {
             "profiles": [
               {
                 "language": "fr",
                 "_id": "5c790acd3f227b1ac45a29b6",
                 "username": "gc",
                 "email": "grdnlndn@gmail.com",
                 "uid": "1"
               }
             ],
             "_id": "59c0cd87740e0704dba1cf6b"
           },
           "ip": "176.164.57.27",
           "edited_at": "2019-04-12T10:02:00.376Z",
           "created_at": "2019-04-12T10:02:00.343Z"
         }

    ]
}

```

- Valid Import Comments in your system, send us confirmation

`$client->exportConfirmComments([comment_id1, comment_id2, comment_id3...]);`

This query return a JSON Array of object :

```
{
    [
     {_id : comment_id1, result: 'ok'},
     {_id : comment_id2, result: 'ko', message:'comment id not found'},
     {_id : comment_id3, result: 'ok'},

    ]
}

```

- Get JSON-LD Format From Url and Uid(optionnal) content for SEO

`$client->getThreadJsonLdFormat('https://graphcomment.com/thread.html', 'content123');`

message is present only if an error exist for a comment upgrade in our database.

Comment export returns the comment if it has changed status, or if it has been edited by the user in case of account deletion or normal editing. you have to do an update or insert function depending on the case.

So you can make a job to get all minutes and import the graphcomment comments in your database.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance54

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 79.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 ~169 days

Recently: every ~595 days

Total

21

Last Release

16d ago

Major Versions

v1.0.7 → v2.0.02018-11-13

v2.3.2 → v3.0.02026-07-30

PHP version history (3 changes)v1.0PHP &gt;=5.6.0

1.0.6PHP &gt;=5.5.0

v3.0.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![daviddjian](https://avatars.githubusercontent.com/u/754950?v=4)](https://github.com/daviddjian "daviddjian (27 commits)")[![ddtraceweb](https://avatars.githubusercontent.com/u/2129919?v=4)](https://github.com/ddtraceweb "ddtraceweb (7 commits)")

---

Tags

phpapicommentgraphcomment

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/graphcomment-sdk-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/graphcomment-sdk-api-php/health.svg)](https://phpackages.com/packages/graphcomment-sdk-api-php)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k54](/packages/neuron-core-neuron-ai)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M777](/packages/sylius-sylius)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k441.1k8](/packages/theodo-group-llphant)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.8M179](/packages/algolia-algoliasearch-client-php)

PHPackages © 2026

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