Sync your gRPC specification
Keeping your gRPC specifications in sync with your codebase is crucial for maintaining accurate SDKs and documentation. Fern provides several automation options to streamline this process.
GitHub Actions
Use Fern’s GitHub Action to automatically update SDKs and documentation when your Protocol Buffer files change.
If you’re using local-generation: true in your generators.yml, you must install buf.
Protocol buffer validation
Validate, lint, and check for breaking changes in your Protocol Buffer files before generating SDKs.
Optional: Push to Buf Schema Registry
If you’re using Buf Schema Registry, add a step to publish your schemas:
Optional: Customize buf configuration
Optionally create a buf.yaml file to customize buf’s linting rules, breaking change detection, and dependencies:
Auto-sync from source
Configure Fern to automatically pull Protocol Buffer files from various sources:
From git repository
From local directory
CI/CD integration
Integrate Fern into your existing CI/CD pipelines to automatically generate SDKs and documentation.
CircleCI
If you’re using local-generation: true in your generators.yml, you must install buf.
GitLab CI
If you’re using local-generation: true in your generators.yml, you must install buf.
Scheduled updates
Set up scheduled updates to ensure your SDKs stay current:
Code generation from gRPC server
For servers that can generate their own Protocol Buffer definitions:
Monitoring changes
Track changes to your Protocol Buffer specifications:
Multi-service sync
Sync different Protocol Buffer services for different components:
gRPC reflection sync
Automatically sync Protocol Buffer definitions from running gRPC services that have server reflection enabled:
This ensures that any changes to your gRPC services are automatically reflected in your SDKs and documentation, maintaining consistency across your entire API ecosystem.