Overview
The Dagger API is extensible and shareable by design.
- You can extend the Dagger API by creating Dagger modules
- You can also embed a Dagger SDK directly into your application
Both approaches let you access Dagger features for container operations, secret management, and more.
Modules
In addition to providing a set of core functions and types, the Dagger API can be extended with custom Dagger Functions and custom types. This is achieved by creating (or installing) Dagger modules. You are encouraged to write your own Dagger modules and share them with others.
When a Dagger module is loaded, the Dagger API is dynamically extended with new Dagger Functions served by that module. So, after loading a Dagger module, an API client can now call all of the original core functions, plus the new Dagger Functions provided by that module.
Dagger also lets you import and reuse modules developed by your team, your organization or the broader Dagger community. The Daggerverse is a free service run by Dagger, which indexes all publicly available Dagger modules and Dagger Functions, and lets you easily search and consume them.
Custom applications
When using a Dagger SDK in your application:
- Install the SDK for your preferred language
- Initialize a Dagger client in your code
- Use Dagger API methods to implement your workflow
- Run your application with
dagger run
The following SDKs are available for embedding Dagger into your application:
- Go → Use the Dagger Go SDK to embed Dagger into your Go applications
- TypeScript → Use the Dagger TypeScript SDK to embed Dagger into your TypeScript applications
- Python → Use the Dagger Python SDK to embed Dagger into your Python applications
- PHP → Use the Dagger PHP SDK to embed Dagger into your PHP applications
Modules vs custom applications
Here is a quick summary of differences between these two approaches.
Dagger modules | Custom applications | |
---|---|---|
Pre-initialized Dagger API client | Y | N |
Direct host access | N | Y |
Direct third-party module access | Y | N |
Cross-language interoperability | Y | N |