Installation
Replace{version} with the version of the SDK you wish to use. This documentation covers version >=3.0.0.
Maven
Gradle
Others
For other build tools, please check our package snippets, and select the build tool you’re using for your project.Getting Started
Core Methods
The SDK methods are organized into the following high-level categories:- Auth(): Handles authentication methods.
- Secrets(): Manages CRUD operations for secrets.
Auth
The Auth component provides methods for authentication:
Universal Auth
Authenticating
- clientId(string): The client ID of your Machine Identity.
- clientSecret(string): The client secret of your Machine Identity.
AWS Auth
- identityId(String): The ID of the machine identity to authenticate with.
LDAP Auth
- input(LdapAuthLoginInput): The input for authenticating with LDAP.- identityId(String): The ID of the machine identity to authenticate with.
- username(String): The LDAP username.
- password(String): The LDAP password.
 
Access Token Auth
Authenticating
- accessToken(string): The access token you want to use for authentication.
Secrets
This sub-class handles operations related to secrets:
List Secrets
- projectId(string): The ID of your project.
- environmentSlug(string): The environment in which to list secrets (e.g., “dev”).
- secretPath(string): The path to the secrets.
- expandSecretReferences(boolean): Whether to expand secret references.
- recursive(boolean): Whether to list secrets recursively.
- includeImports(boolean): Whether to include imported secrets.
- setSecretsOnSystemProperties(boolean): Set the retrieved secrets as key/value pairs on the system properties, making them accessible through- System.getProperty("<secret-key>")
- List<Secret>: The response containing the list of secrets.
Create Secret
- secretName(string): The name of the secret to create
- secretValue(string): The value of the secret.
- projectId(string): The ID of your project.
- environmentSlug(string): The environment in which to create the secret.
- secretPath(string, optional): The path to the secret.
- Secret: The created secret.
Update Secret
- secretName(string): The name of the secret to update.
- projectId(string): The ID of your project.
- environmentSlug(string): The environment in which to update the secret.
- secretPath(string): The path to the secret.
- newSecretValue(string, nullable): The new value of the secret.
- newSecretName(string, nullable): A new name for the secret.
- Secret: The updated secret.
Get Secret by Name
- secretName(string): The name of the secret to get`
- projectId(string): The ID of your project.
- environmentSlug(string): The environment in which to retrieve the secret.
- secretPath(string): The path to the secret.
- expandSecretReferences(boolean, optional): Whether to expand secret references.
- includeImports(boolean, optional): Whether to include imported secrets.
- secretType(personal | shared, optional): The type of secret to fetch.
- Secret: The fetched secret.
Delete Secret by Name
- secretName(string): The name of the secret to delete.
- projectId(string): The ID of your project.
- environmentSlug(string): The environment in which to delete the secret.
- secretPath(string, optional): The path to the secret.
- Secret: The deleted secret.
Folders
Get Folder By Name
- folderId(String): The ID of the folder to retrieve.
- Folder: The retrieved folder.
List Folders
- input(ListFoldersInput): The input for listing folders.- projectId(String): The ID of the project to list folders from.
- environmentSlug(String): The slug of the environment to list folders from.
- folderPath(String): The path to list folders from. Defaults to- /.
- recursive(Boolean): Whether or not to list sub-folders recursively from the specified folder path and downwards. Defaults to- false.
 
- List<Folder>: The retrieved folders.
Create Folder
- input(CreateFolderInput): The input for creating a folder.- projectId(String): The ID of the project to create the folder in.
- environmentSlug(String): The slug of the environment to create the folder in.
- folderPath(String): The path to create the folder in. Defaults to- /.
- folderName(String): The name of the folder to create.
- description(String): The description of the folder to create. This is optional.
 
- Folder: The created folder.
Update Folder
- input(UpdateFolderInput): The input for updating a folder.- projectId(String): The ID of the project where the folder exists.
- environmentSlug(String): The slug of the environment where the folder exists.
- folderPath(String): The path of the folder to update.
- folderId(String): The ID of the folder to update.
- newFolderName(String): The new folder name.
 
- Folder: The updated folder.
Delete Folder
- input(DeleteFolderInput): The input for deleting a folder.- projectId(String): The ID of the project where the folder exists.
- environmentSlug(String): The slug of the environment where the folder exists.
- folderId(String): The ID of the folder to delete.
 
- Folder: The deleted folder.