Publishing to Packagist
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. See Set up thefern
folder. - A GitHub repository for your SDK. See Project Structure.
Configure generators.yml
Set up Packagist publishing authentication
Submit the Repository URL
- Click Submit.
- Input the full URL of the repository where you generated your PHP SDK, then click Check.
- Fix any errors Packagist finds in your repository, then click Submit.

Configure the GitHub Hook
Once you’ve submitted your URL, you’ll be prompted to set up the GitHub Hook.
- In to your repository, go to Settings > Webhooks.
- Select “Add webhook”
- Set the Payload URL as
https://packagist.org/api/github?username=<your.packagist.username>
- Set the content type as
application/json
- Packagist autogenerates API Tokens. To find yours, go to your Profile. Then, add your token to the Secret field.
- Set the trigger events as Just the
push
event - Click “Add Webhook”

Release your SDK to Packagist
At this point, you’re ready to regenerate your SDK and publish it on Packagist:
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.