Secrets & API Keys

Using Secrets and API Keys

Ensuring the security of your applications and workflows is paramount. Hardcoding sensitive information like secret keys directly into your code can lead to potential vulnerabilities and increased costs due to unauthorized access. BuildShip addresses this concern by providing an effective way to safeguard your secret keys using Google Cloud Platform (GCP) Secret Manager under the hood.

What is a Secret?

A secret is an global object used within a project that holds sensitive information. This information can include things like API keys, passwords, certificates, and credentials. Secrets are used to securely store, manage, and control access to sensitive information. In BuildShip you can add secrets in any form such as single string, json object, or a key-value pair. BuildShip Secret Manager is a secure and convenient way to store and manage your secrets.

💡

Example: If the Secret requires a collection of data then you can also store it as a JSON Object, example: The PlayHT (opens in a new tab) secret requires a secretKey and userID.

{
  "secretKey": "Paste your secret key",
  "userId": "Paste your userId"
}

How BuildShip stores a secret securely on Google Cloud Secret Manager?

BuildShip integrates with Google Cloud Secret Manager so you don't have your secrets exposed in your frontend application and ensures that your keys remain confidential and are only accessed when needed. When you add a secret in BuildShip, it is stored in Google Cloud Secret Manager. The secret is encrypted at rest and in transit. The secret is only decrypted when it is used in the workflow.

Add Secret Key Input Parameter

  • Navigate to the Node Editor for a logic node where you intend to use a secret key.

  • In the Params section, add a new input parameter to receive the Secret Key.

  • For example, let's say you want to use the Replicate API Key. Create an input parameter as follows:

    [
      {
        key: 'apiKey',
        label: 'Replicate API Key',
        description: 'The API Key for Replicate',
        required: false,
        validation: '',
        type: 'string',
      },
    ];

    or via UI Form:

    Secret Key Input Parameter
  • Save the input parameter.

Access Secret Key in Node Logic

  • Within the Node Editor, navigate to the Node Logic section.

  • Import the input parameters into your function, for example:

    export default async function runMusicGenModel({ prompt, apiKey }) {
      // Your code here
    }
  • Use the apiKey variable to access the API Key value in your logic:

    const replicate = new Replicate({
      auth: apiKey,
    });
    Access Secret Key in Node Logic
  • Save your changes.

Add Secret in BuildShip Secret Manager

  • Back to your workflow workspace, click on the Expression Icon </> corresponding to the API Key input in your Logic Node.
  • Under "Secrets," click on "Add a Secret". This action opens the BuildShip Secret Manager. Add Secret in BuildShip Secret Manager
  • Inside the BuildShip Secret Manager, you have the ability to add, modify, or delete secret keys.
  • Click "Add a Secret Key", then provide the "Secret Name" and "Secret Value" associated with your API Key. Add Secret in BuildShip Secret Manager
  • Click "Save" to add the secret key to the BuildShip Secret Manager.

Select Secret Key in Node Editor

  • Back in the Node Editor, within the Secrets section, click "Refresh."
  • Select the Secret Key you added from the dropdown menu.

And that's it! 🚀 By following these steps, you can seamlessly integrate secret keys into your workflows while ensuring their confidentiality and security through BuildShip's Secret Manager integration.

Need Help?

  • 💬
    Join BuildShip Community

    An active and large community of no-code / low-code builders. Ask questions, share feedback, showcase your project and connect with other BuildShip enthusiasts.

  • 🙋
    Hire a BuildShip Expert

    Need personalized help to build your product fast? Browse and hire from a range of independent freelancers, agencies and builders - all well versed with BuildShip.

  • 🛟
    Send a Support Request

    Got a specific question on your workflows / project or want to report a bug? Send a us a request using the "Support" button directly from your BuildShip Dashboard.

  • ⭐️
    Feature Request

    Something missing in BuildShip for you? Share on the #FeatureRequest channel on Discord. Also browse and cast your votes on other feature requests.