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

v2.3.2(6y ago)52911MITPHPPHP &gt;=5.5.0

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-php-api)[ RSS](/packages/graphcomment-sdk-api-php/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (1)Versions (20)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

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Recently: every ~71 days

Total

19

Last Release

2307d ago

Major Versions

v1.0.7 → v2.x-dev2018-11-13

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

1.0.6PHP &gt;=5.5.0

### Community

Maintainers

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

---

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

### 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

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[theodo-group/llphant

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

1.5k311.5k5](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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