PHPackages                             onlyoffice/docs-integration-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. onlyoffice/docs-integration-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

onlyoffice/docs-integration-sdk
===============================

ONLYOFFICE Docs integration SDK

1.4.0(3mo ago)390.1k↓40.3%4Apache-2.0PHPCI passing

Since Sep 20Pushed 2w ago5 watchersCompare

[ Source](https://github.com/ONLYOFFICE/docs-integration-sdk-php)[ Packagist](https://packagist.org/packages/onlyoffice/docs-integration-sdk)[ Docs](https://www.onlyoffice.com)[ RSS](/packages/onlyoffice-docs-integration-sdk/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (7)Dependencies (2)Versions (16)Used By (0)

ONLYOFFICE Docs Integration PHP SDK
===================================

[](#onlyoffice-docs-integration-php-sdk)

ONLYOFFICE Docs Integration PHP SDK provides common interfaces and default implementations for integrating ONLYOFFICE Document Server into your own website or application on PHP.

Prerequisites
-------------

[](#prerequisites)

- **PHP**: version 7.4.0 and higher

### Managers

[](#managers)

ManagerDescriptionDefault implementationDocumentManagerInterfaceThis manager is used for working with files, and string data associated with documents.DocumentManager (abstract)FormatsManagerInterfaceThis manager is used for working with document formats.FormatsManagerJwtManagerInterfaceThis manager is used for generating and verifying authorization tokens.JwtManager (abstract)SettingsManagerInterfaceThis manager is used to manage integration application settings.SettingsManager (abstract)### Services

[](#services)

ServiceDescriptionDefault implementationCallbackServiceInterfaceThis service is used for processing the response of the Document Server.CallbackService (abstract)DocEditorConfigServiceInterfaceThis configuration generation service is used for opening the document editor.DocEditorConfigServiceRequestServiceInterfaceThis service is used to make requests to the ONLYOFFICE Document Server.RequestService (abstract)Usage
-----

[](#usage)

1. Implement the methods of the abstract **DocumentManager** class: ```
    public function getDocumentKey(string $fileId, bool $embedded = false)
    {
        return self::generateRevisionId($fileId);
    }

    public function getDocumentName(string $fileId)
    {
        return "sample.docx";
    }

    public static function getLangMapping()
    {
        return null;
    }

    public static function getFileUrl(string $fileId)
    {
        return "https://example-server.example/fileId/download/";
    }

    public static function getCallbackUrl(string $fileId)
    {
        return "https://example-server.example/callback";
    }

    public static function getGobackUrl(string $fileId)
    {
        return "https://example-server.example/filelist";
    }

    public static function getCreateUrl(string $fileId)
    {
        return "https://example-server.example/fileId";
    }
    ```
2. Implement the methods of the abstract **JwtManager** class (use third-party libraries for JWT encoding and decoding, whichever is convenient for you): ```
    public function encode($token, $key, $algorithm = "HS256")
    {
        return "SOME.JWT.STRING";
    }

    public function decode($token, $key, $algorithm = "HS256")
    {
        return json_encode([]);
    }
    ```
3. Implement the methods of the abstract **SettingsManager** class: ```
    public function getServerUrl()
    {
        return "https://example-server.example/";
    }

    public function getSetting($settingName)
    {
        return null;
    }

    public function setSetting($settingName, $value, $createSetting = false)
    {
        // if ($createSetting === true) {
            // $this->yourMethodForCreateNewSetting($settingName, $value);
            // return;
        // }
        // $this->yourMethodForSetNewValueForSetting($settingName, $value);
    }
    ```
4. Implement the methods of the abstract **SettingsManager** class: ```
    public function processTrackerStatusEditing()
    {
        // $someTrackResult["error"] = 0;
        // return json_encode($someTrackResult);
    }

    public function processTrackerStatusMustsave()
    {
        // $someTrackResult["error"] = 0;
        // return json_encode($someTrackResult);
    }

    public function processTrackerStatusCorrupted()
    {
        // $someTrackResult["error"] = 0;
        // return json_encode($someTrackResult);
    }

    public function processTrackerStatusClosed()
    {
        // $someTrackResult["error"] = 0;
        // return json_encode($someTrackResult);
    }

    public function processTrackerStatusForcesave()
    {
        // $someTrackResult["error"] = 0;
        // return json_encode($someTrackResult);
    }
    ```
5. Create a class that implements the **HttpClientInterface** interface (use PHP Client URL Library or any other third-party library to make requests): ```
    class YourHttpClient implements HttpClientInterface
    {
        public function __construct()
        {
            $this->responseStatusCode = null;
            $this->responseBody = null;
        }

        public function getStatusCode()
        {
            return $this->responseStatusCode;
        }

        public function getBody()
        {
            return $this->responseBody;
        }

        public function request($url, $method = 'GET', $opts = [])
        {
            $this->responseStatusCode = 200;
            $this->responseBody = "{\"status\": \"OK\"}";
        }
    }
    ```
6. Implement the method of the abstract **RequestService** class: ```
    public function getFileUrlForConvert()
    {
        return "https://example-server.example/file-url-for-check-convert";
    }
    ```
7. Use DocEditorConfigService to create a config model for the editors in your own controllers.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~45 days

Recently: every ~99 days

Total

13

Last Release

109d ago

Major Versions

v0.0.5 → v1.0.02024-10-15

### Community

Maintainers

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

---

Top Contributors

[![LinneyS](https://avatars.githubusercontent.com/u/8580527?v=4)](https://github.com/LinneyS "LinneyS (77 commits)")[![mwgiorno](https://avatars.githubusercontent.com/u/43139928?v=4)](https://github.com/mwgiorno "mwgiorno (5 commits)")[![aleksandrfedorov97](https://avatars.githubusercontent.com/u/62958171?v=4)](https://github.com/aleksandrfedorov97 "aleksandrfedorov97 (1 commits)")[![kseniafedoruk](https://avatars.githubusercontent.com/u/39296259?v=4)](https://github.com/kseniafedoruk "kseniafedoruk (1 commits)")

---

Tags

integratiopnonlyofficephpsdkdocsonlyoffice

### Embed Badge

![Health badge](/badges/onlyoffice-docs-integration-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/onlyoffice-docs-integration-sdk/health.svg)](https://phpackages.com/packages/onlyoffice-docs-integration-sdk)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

43785.5k4](/packages/lullabot-drainpipe)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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