> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Publish PHP SDKs manually

This guide covers publishing PHP SDKs manually. For information on automating PHP SDK publishing, see [Publish PHP SDKs automatically](/docs/sdk-generator/publish/php-auto/).

To share your generated PHP SDK with the community, you can publish it to [Packagist](https://packagist.org). This enables other developers to install it using `composer require`.

## Prerequisites

To publish your SDK to Packagist, you need the following:

* A public Git repository (for example, GitHub or GitLab).
* A [Packagist](https://packagist.org) account.
* A valid `composer.json` with a `name` field in `vendor/package` format.

## Initial setup

1. Push your SDK to a public repository.

2. Sign in to [Packagist](https://packagist.org) and click **Submit**.

3. Enter your repository URL and submit. Packagist validates your `composer.json` and creates the package listing.

4. Configure a GitHub webhook so Packagist automatically picks up new versions. In your repository settings, follow the instructions shown on your Packagist package page under **Set up GitHub Hook**.

## Configure composer.json

Your SDK's `composer.json` should include the following fields for a proper Packagist listing:

```json
{
    "name": "your-vendor/your-sdk",
    "description": "SDK for Your API",
    "type": "library",
    "license": "MIT",
    "authors": [
        {
            "name": "Your Name",
            "email": "your@email.com"
        }
    ],
    "require": {
        "php": "^8.0",
        "guzzlehttp/guzzle": "^7.0",
        "symfony/serializer": "^7.0",
        "symfony/property-info": "^7.0",
        "symfony/property-access": "^7.0",
        "phpdocumentor/reflection-docblock": "^5.4"
    },
    "autoload": {
        "psr-4": {
            "YourSdk\\": "src/"
        }
    }
}
```

## Publish your PHP SDK to Packagist

To publish your SDK, do the following:

1. Tag a release using [semantic versioning](https://semver.org).

   ```bash
   git tag v1.0.0
   git push origin v1.0.0
   ```

2. Packagist picks up the tag automatically if the webhook is configured. Otherwise, trigger a manual update from your package page.

3. Verify the publication at `https://packagist.org/packages/your-vendor/your-sdk`.

## Publish updates

To publish updates to your SDK, do the following:

```bash
# Tag a new version
git tag v1.0.1
git push origin v1.0.1
```

## Best practices for publishing PHP SDKs

Use the following best practices when publishing your PHP SDK to Packagist:

* Use semantic versioning.
* Include a comprehensive `README.md` with installation and usage instructions.
* Tag releases in Git rather than relying on branch-based version constraints.
* Declare a specific PHP version constraint in `composer.json` (for example, `"php": "^8.1"`).
* Run your test suite before tagging a release.