Using Dynamic Values in Bubble API Connector

Normally, when you set up an API in Bubble, you add fixed values (like an API Key or ID).
But often, you need those values to change dynamically depending on the user or workflow.

For example:

  • Each user has their own API key.

  • Or you need to pass a search term from an input box to the API.

This is where dynamic values come in.


:small_blue_diamond: How to Use Dynamic Values

  1. In API Connector, when defining headers or parameters, instead of hardcoding a value:

    • Put a placeholder like <>.

    • Example:

      Header → Authorization: Bearer <API_KEY>
      
      
  2. When using the API call inside a workflow, Bubble will let you fill in that <API_KEY> dynamically.

    • Example: Current User’s API Key

:small_blue_diamond: Example Scenario

:backhand_index_pointing_right: Suppose you’re connecting to OpenAI API.

In API Connector:

  • Header:

    Authorization = Bearer <dynamic_api_key>
    
    

In Workflow:

  • Call API → Replace <dynamic_api_key> with Current User’s OpenAI Key.

Now, each user can connect with their own key, instead of one fixed key for everyone.


:small_blue_diamond: Why it’s important

  • Makes your app scalable (works for multiple users).

  • Improves security (users don’t share the same key).

  • Allows flexibility (different queries, different accounts).

1 Like