Adding custom code
Enterprise feature
This feature is available only for the Enterprise plan. To get started, reach out to support@buildwithfern.com.
This page covers how to add custom logic, methods, and dependencies to your PHP SDK.
Adding custom logic
To get started adding custom code:
These steps cover adding a new custom file to the SDK. To preserve line-level edits to a generated file, use Replay instead.
Adding custom SDK methods
Fern also allows you to add custom methods to the SDK itself (e.g.
client.my_method() ) by inheriting the Fern generated client and then
extending it.
Update sdk-config.yml configuration
Name your Fern-generated client something like BaseClient to reflect that this client will be extended.
sdk-config.yml
Adding custom dependencies
To add packages that your custom code requires, list them in the target’s package.extraDependencies and package.extraDevDependencies in sdk-config.yml.
sdk-config.yml