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
  • SDK configuration options
  • clientName
  • composerJson
  • enable-wire-tests
  • inlinePathParameters
  • maxRetries
  • namespace
  • offsetSemantics
  • omitFernHeaders
  • packageName
  • packagePath
  • propertyAccess
GeneratorsPHP

PHP configuration

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

Publishing to Packagist

Next

Adding custom code

You can customize the behavior of the PHP SDK generator in generators.yml:

generators.yml
1groups:
2 php-sdk:
3 generators:
4 - name: fernapi/fern-php
5 version: 2.9.0
6 config:
7 clientName: YourClientName

SDK configuration options

clientName
string

Sets the name of the generated API client class. This determines the primary client type name that users will interact with in the generated PHP SDK.

composerJson
Record<string, any>

Allows customization of the generated composer.json file contents. You can specify additional metadata, dependencies, or configuration that will be merged into the package’s composer configuration file.

enable-wire-tests
booleanDefaults to false

When enabled, generates mock server (wire) tests to verify that the SDK sends and receives HTTP requests as expected.

inlinePathParameters
boolean

When enabled, path parameters are included as properties in the request class instead of being passed as separate method parameters. This creates a more unified request structure where all parameters are grouped together in the request object.

maxRetries
number

The default number of retries for failed requests. When not set, the generated SDK uses its own built-in default. SDK users can still override this per-request via request options.

namespace
string

Specifies the PHP namespace for all generated code. This determines the namespace hierarchy that users will use when importing and using the SDK classes.

offsetSemantics
'item-index' | 'page-index'

Controls how the offset parameter is interpreted for auto-paginated endpoints.

  • item-index: The offset counts individual items (e.g., offset 20 skips the first 20 items).
  • page-index: The offset counts pages (e.g., offset 3 skips to page 3).
omitFernHeaders
booleanDefaults to false

When enabled, the generated SDK omits the X-Fern-Language, X-Fern-SDK-Name, and X-Fern-SDK-Version headers from HTTP requests.

packageName
string

Sets the name of the PHP package as it will appear in Composer and Packagist. This is the name users will use to install the SDK via Composer (e.g., composer require your/package-name).

packagePath
string

Specifies the directory path where the generated SDK source files should be placed. This determines the file system location of the generated PHP code relative to the output directory.

propertyAccess
'public' | 'private'

Controls the access level of generated class properties. When set to ‘public’, properties are public and getter/setter methods are omitted. When set to ‘private’, properties are private and getter/setter methods are generated for encapsulation.