4.0.0
are officially fully unsupported.
Please upgrade to version 4.0.0 or newer in order to receive the latest updates.
auth
: Handles authentication methods.secrets
: Manages CRUD operations for secrets.dynamicSecrets
: Manages dynamic secrets and leases.projects
: Creates and manages projects.environments
: Creates and manages environments.folders
: Creates and manages folders.auth
Auth
component provides methods for authentication:
options
(object):
clientId
(string): The client ID of your Machine Identity.clientSecret
(string): The client secret of your Machine Identity.renew()
method.
.login()
method call, the access token returned will be auto set for the client instance. However, if you wish to set the access token manually, you may use this method.
accessToken
(string): The access token to be used for authentication. This should not include “Bearer”.options
(object):
identityId
(string): The ID of your identityrenew()
method.
secrets
projectId
(string): The ID of your project.environment
(string): The environment in which to list secrets (e.g., “dev”).secretPath
(str): The path to the secrets.expandSecretReferences
(bool, optional): Whether to expand secret references.viewSecretValue
(bool, optional): Whether or not to reveal the secret value of the secrets. If set to false
, the secretValue
is masked with <hidden-by-infisical>
. Defaults to true
.recursive
(bool, optional): Whether to list secrets recursively.includeImports
(bool, optional): Whether to include imported secrets.tagFilters
(string[], optional): Tags to filter secrets.ListSecretsResponse
: The response containing the list of secrets.listSecretsWithImports
method makes it easier to get all your secrets at once. The imported secrets will automatically be added to the secrets returned. The secrets in the selected environment will take precedence over the imported secrets. This means if you have secrets with conflicting names, the secret from the environment the import was imported into, will take precedence.
projectId
(string): The ID of your project.environment
(string): The environment in which to list secrets (e.g., “dev”).secretPath
(str): The path to the secrets.expandSecretReferences
(bool, optional): Whether to expand secret references.viewSecretValue
(bool, optional): Whether or not to reveal the secret value of the secrets. If set to false
, the secretValue
is masked with <hidden-by-infisical>
. Defaults to true
.recursive
(bool, optional): Whether to list secrets recursively.tagFilters
(string[], optional): Tags to filter secrets.Secret[]
: Returns the list of secrets objects, with imports.secretName
(string): The name of the secret to createoptions
(object):
projectId
(string): The ID of your project.environment
(str): The environment in which to create the secret.secretValue
(str): The value of the secret.secretPath
(string, optional): The path to the secret.secretComment
(str, optional): A comment associated with the secret.skipMultilineEncoding
(bool, optional): Whether to skip encoding for multiline secrets.secretReminderNote
(string, optional): A note for the secret reminder.secretReminderRepeatDays
(number, optional): Number of days after which to repeat secret reminders.tagIds
(string[], optional): Array of tags to assign to the new secret.type
(personal | shared, optional): Which type of secret to create.CreateSecretResponse
: The response after creating the secret.secretName
(string): The name of the secret to update.`options
(object):
environment
(str): The environment in which to update the secret.projectId
(str): The ID of your project.secretValue
(str, optional): The new value of the secret.newSecretName
(str, optional): A new name for the secret.secretComment
(str, optional): An updated comment associated with the secret.secretPath
(str): The path to the secret.secretReminderNote
(str, optional): An updated note for the secret reminder.secretReminderRepeatDays
(number, optional): Updated number of days after which to repeat secret reminders.skipMultilineEncoding
(bool, optional): Whether to skip encoding for multiline secrets.tagIds
(string[], optional): Array of tags to assign to the secret.type
(personal | shared, optional): Which type of secret to create.metadata
(object, optional): Assign additional details to the secret, accessible through the API.UpdateSecretResponse
: The response after updating the secret.environment
(str): The environment in which to retrieve the secret.projectId
(str): The ID of your project.secretName
(str): The name of the secret.secretPath
(str, optional): The path to the secret.expandSecretReferences
(bool, optional): Whether to expand secret references.viewSecretValue
(bool, optional): Whether or not to reveal the secret value of the secret. If set to false
, the secretValue
is masked with <hidden-by-infisical>
. Defaults to true
.includeImports
(bool): Whether to include imported secrets.version
(str, optional): The version of the secret to retrieve. Fetches the latest by default.type
(personal | shared, optional): The type of secret to fetch.Secret
: Returns the secret object.secretName
(string): The name of the secret to delete.options
(object):
projectId
(str): The ID of your project.environment
(str): The environment in which to delete the secret.secret_path
(str, optional): The path to the secret.type
(personal | shared, optional): The type of secret to delete.DeleteSecretResponse
: The response after deleting the secret.dynamicSecrets
.dynamicSecrets().create({})
function. More details below.
The input for creating new dynamic secret varies greatly between secret types.
For a more in-depth description of each input type for each dynamic secret type, please refer to our API documentation
DynamicSecret
: The created dynamic secret.secretName
(string): The ID of the dynamic secret to deleteoptions
(object):
projectSlug
(str): The ID of your project.environment
(str): The environment in which to delete the secret.DynamicSecret
: The deleted dynamic secret.dynamicSecrets.leases
lease.data
in this example.
Parameters:
dynamicSecretName
(string): The name of the dynamic secret you wish to create a lease for.projectSlug
(string): The slug of the project where the secret is located.environmentSlug
(string): The environment where the dynamic secret is located.path
(string, optional): The path of where the dynamic secret is located.ttl
(string, optional): A vercel/ms encoded string representation of how long the lease credentials should be valid for. This will default to the dynamic secret’s default TTL if not specified.CreateLeaseResponse
: The dynamic secret lease result.leaseId
(string): The ID of the lease you want to delete.projectSlug
(string): The slug of the project where the secret is located.environmentSlug
(string): The environment where the dynamic secret is located.path
(string, optional): The path of where the dynamic secret is located.isForced
(bool, optional): Whether or not to forcefully delete the lease. This can’t guarantee that the lease will be deleted from the external provider, and is potentially unsafe for sensitive dynamic secrets.DeleteLeaseResponse
: The deleted lease result.leaseId
(string): The ID of the lease you want to delete.options
(object):
projectSlug
(string): The slug of the project where the secret is located.environmentSlug
(string): The environment where the dynamic secret is located.path
(string, optional): The path of where the dynamic secret is located.ttl
(string, optional): A vercel/ms encoded string representation of how long the lease credentials should be valid for. This will default to the dynamic secret’s default TTL if not specified.RenewLeaseResponse
: The renewed lease response (doesn’t contain new credentials).projects
projectName
(string): The name of the project to create.type
(string): The type of project to create. Valid options are secret-manager
, cert-manager
, kms
, ssh
projectDescription
(string): An optional description of the project to create.slug
(string): An optional slug for the project to create. If not provided, one will be generated automatically.template
(string): Optionally provide a project template name to use for creating this project.kmsKeyId
(string): The ID of the KMS key to use for the project. Will use the Infisical KMS by default.Project
: The project that was created.emails
or usernames
. If neither are specified, the SDK will throw an error.
projectId
: (string): The ID of the project to invite members toemails
: (string[]): An array of emails of the users to invite to the project.usernames
: (string[]) An array of usernames of the users to invite to the project.roleSlugs
: (string[]): An array of role slugs to assign to the members. If not specified, this will default to member
.Membership[]
: An array of the created project memberships.environments
name
(string): The name of the environment to be created.projectId
(string): The ID of the project to create the environment within.slug
: (string): The slug of the environment to be created.position
(number): An optional position of the environment to be created. The position is used in the Infisical UI to display environments in order. Environments with the lowest position come first.Environment
: The environment that was created.name
(string): The name of the folder to create.path
(string): The path where of where to create the folder. Defaults to /
, which is the root folder.projectId
(string): The ID of the project to create the folder within.environment
(string): The slug of the environment to create the folder within.description
(string): An optional folder description.Folder
: The folder that was created.environment
(string): The slug of the environment to list folders within.projectId
(string): The ID of the project to list folders within.path
(string): The path to list folders within. Defaults to /
, which is the root folder.recursive
(boolean): An optional flag to list folders recursively. Defaults to false
.Folder[]
: An array of folders.