For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Overview
    • Introduction
    • How it works
    • Quickstart
    • Customer showcase
  • Working with SDKs
    • Project structure
    • Adding custom code
    • Migrating to Replay
    • Capabilities
  • Generators
      • Generating an SDK
      • Publishing to Packagist
      • Configuration
      • Adding custom code
      • Changelog
      • Customer showcase
  • Reference
    • generators.yml
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • Configure generators.yml
  • Set up Packagist publishing authentication
  • Release your SDK to Packagist
GeneratorsPHP

Publishing to Packagist

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Generating an SDK

Next

PHP configuration

Publish your public-facing Fern PHP SDK to the Packagist registry. After following the steps on this page, you’ll have a versioned package published on Packagist.

This page assumes that you have:

  • An initialized fern folder, a GitHub repository for your PHP SDK, and a PHP generator group in generators.yml. See Generating an SDK (PHP).
Versioned package published on Packagist

Configure generators.yml

1

Add repository location

PHP publishes via Git repositories, so remove the auto-generated output, location, and path fields. Instead, add the path to your GitHub repository:

1groups:
2 php-sdk:
3 generators:
4 - name: fernapi/fern-php-sdk
5 version: 4.23.2
6 github:
7 repository: your-org/company-php

Set up Packagist publishing authentication

1

Log into Packagist

Log into Packagist or create an account with Packagist.

2

Submit the Repository URL

  1. Click Submit.
  2. Input the full URL of the repository where you generated your PHP SDK, then click Check.
  3. Fix any errors Packagist finds in your repository, then click Submit.
Submit Package Screen in Packagist
3

Configure the GitHub Hook

Once you’ve submitted your URL, you’ll be prompted to set up the GitHub Hook.

  1. In to your repository, go to Settings > Webhooks.
  2. Select “Add webhook”
  3. Set the Payload URL as https://packagist.org/api/github?username=<your.packagist.username>
  4. Set the content type as application/json
  5. Packagist autogenerates API Tokens. To find yours, go to your Profile. Then, add your token to the Secret field.
  6. Set the trigger events as Just the push event
  7. Click “Add Webhook”
GitHub Webhook for Packagist

Release your SDK to Packagist

At this point, you’re ready to regenerate your SDK and publish it on Packagist:

$fern generate --group php-sdk --version <version>

Local machine output will verify that the release is pushed to your repository and tagged with the version you specified. Log back into Packagist, click on your username, and select My packages to see your new release.