diff --git a/fern/products/sdks/overview/php/quickstart.mdx b/fern/products/sdks/overview/php/quickstart.mdx index ad0fc6b1b..bc230e274 100644 --- a/fern/products/sdks/overview/php/quickstart.mdx +++ b/fern/products/sdks/overview/php/quickstart.mdx @@ -3,6 +3,89 @@ title: PHP Quickstart description: Get started quickly with the Fern PHP SDK. --- -# PHP Quickstart + -Follow these steps to quickly get up and running with the Fern PHP SDK. \ No newline at end of file +Generate a PHP SDK by following the instructions on this page. + + + + + ### Initialize the Fern Folder + + You can use either the OpenAPI definition, AsyncAPI definition, or Fern + Definition to generate your SDK. + + + + + + + + + + + 2. Add the config option `outputSourceFiles: true` to + `generators.yml`. This ensures your SDK contains source files in + your preferred SDK language instead of compiled output. + + ```yaml {11-12} + # yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json + default-group: local + groups: + local: + generators: + - name: fernapi/fern-typescript-node-sdk + output: + location: local-file-system + path: ../sdks/typescript + version: + config: + outputSourceFiles: true + ``` + + `fern init` creates a default configuration that includes the + TypeScript Node SDK generator. The `local` group containing this + generator only generates if you run fern generate without specifying a + group, or if you explicitly target it with `fern generate --group + local`. In subsequent steps, you'll add an additional generator for your + preferred SDK language. + + + + + + +### Add the SDK generator + +Add the PHP SDK generator: + +```bash +fern add fern-php-sdk --group sdk +``` + +This command adds the following to `generators.yml`: + +```yaml + sdk: + generators: + - name: fernapi/fern-php-sdk + version: + output: + location: local-file-system + path: ../sdks/php/sdk +``` + + + +```bash +fern/ # created in step 1 +sdks/ # created by fern generate --group sdk +├─ php + └─ sdk/ + ├─ src/ + ├─ YourOrganizationClient.php + └─ Imdb/ # or the name of your API + └─ tests/ + └─ Core/ +``` +