# Firebase Destination Config Reference

<p><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/firebase/" >Firebase</a> is a mobile analytics destination that runs only in device mode. RudderStack&rsquo;s mobile SDKs load the Firebase SDK in the app and log <code>identify</code>, <code>track</code>, and <code>screen</code> calls to Google Analytics for Firebase from there, mapping <code>track</code> events to Firebase&rsquo;s standard events where they match.</p>
<p>In a Firebase destination spec:</p>
<ul>
<li><code>type: firebase</code></li>
<li><code>definition_version: 1</code></li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="sample-configuration">Sample configuration</h2><div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: destination
metadata:
  name: firebase-prod
spec:
  id: firebase-prod
  display_name: Firebase Production
  type: firebase
  definition_version: 1
  enabled: true
  config:
    event_filtering:
      blacklist:
        - Application Backgrounded
        - Debug Event

    connection_mode:
      android_kotlin: device
      ios_swift: device
    consent_management:
      android_kotlin:
        - provider: oneTrust
          consents:
            - analytics</code></pre></div>
</div>
<p>The above example connects Kotlin and Swift apps. The Firebase project itself isn&rsquo;t configured here — the app bundles it, in the <code>google-services.json</code> or <code>GoogleService-Info.plist</code> file Firebase generates — so <code>event_filtering</code> is the only Firebase-specific key. See <a href="#event-filtering" >Event filtering</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="config-keys">Config keys</h2><p><code>config</code> accepts only the keys listed below. The <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/#config-key-rules" >shared config key rules</a> cover unknown keys, defaults, and immutability.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Firebase runs only in <code>device</code> mode. The mobile SDKs send it <code>identify</code>, <code>track</code>, and <code>screen</code> calls from the app, so every key below configures what the SDK does in the app.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="event-filtering">Event filtering</h3><p>Every source connects to Firebase in <code>device</code> mode, where the SDK applies the filter, so <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/event-filtering/" >client-side event filtering</a> applies to <code>track</code> events from every source.</p>
<div class="rs-ckeys">
<div class="rs-ckey" id="event_filtering">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">event_filtering</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Restricts which <code>track</code> events the SDK passes to Firebase, by event name.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li><code>whitelist</code> — array of event names to allow; every other <code>track</code> event is dropped.</li>
<li><code>blacklist</code> — array of event names to drop; every other <code>track</code> event is allowed.</li>
<li>The two are mutually exclusive, and Rudder CLI enforces it — setting both fails validation.</li>
<li>Each name is at most 100 characters, or a <code>{{ path || fallback }}</code> template.</li>
<li>Omit the block entirely to filter nothing.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">event_filtering:
  whitelist:
    - Order Completed
    - Product Added</code></pre></div>
</div>

</div>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="per-source-keys">Per-source keys</h3><p>Both keys are objects keyed by the local source type — the tokens listed under <a href="#source-types" >Source types</a>. A key naming a source type this destination doesn&rsquo;t support fails validation.</p>
<div class="rs-ckeys">
<div class="rs-ckey" id="connection_mode">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">connection_mode</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Maps each source type you connect to the mode its events reach Firebase in. Firebase accepts only <code>device</code>.
</p>

<div class="rs-ckey__notes">
  <p class="rs-ckey__field">Notes:</p>
  <ul>
<li>An entry is required for each source type you connect — see <a href="#connect-a-source" >Connect a source</a>.</li>
<li>Any other mode fails validation — for example <code>cloud</code> for <code>android</code>.</li>
</ul>

</div>

<div class="rs-ckey__extra">
  <div class="rs-code">
  <div class="rs-code__head">yaml<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">connection_mode:
  android: device
  ios: device
  react_native: device</code></pre></div>
</div>

</div>

</div>

<div class="rs-ckey" id="consent_management">
  <div class="rs-ckey__title">
    <p class="rs-ckey__name">consent_management</p></div>
  <p class="rs-ckey__field">
    Type:
    <code>object</code>
  </p>
<p class="rs-ckey__field">
  Description:
  Consent provider configuration per source type. The entry shape, accepted providers, and the rules on <code>resolution_strategy</code> and <code>consents</code> are shared across all destination types — see <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/#consent-management" >Consent management</a>.
</p>

</div>

</div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="source-types">Source types</h2><p>Firebase accepts events from these source types in the mentioned connection modes:</p>
<table>
  <thead>
      <tr>
          <th>Source type</th>
          <th>Connection mode</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>android</code></td>
          <td><code>device</code></td>
      </tr>
      <tr>
          <td><code>android_kotlin</code></td>
          <td><code>device</code></td>
      </tr>
      <tr>
          <td><code>ios</code></td>
          <td><code>device</code></td>
      </tr>
      <tr>
          <td><code>ios_swift</code></td>
          <td><code>device</code></td>
      </tr>
      <tr>
          <td><code>unity</code></td>
          <td><code>device</code></td>
      </tr>
      <tr>
          <td><code>react_native</code></td>
          <td><code>device</code></td>
      </tr>
      <tr>
          <td><code>flutter</code></td>
          <td><code>device</code></td>
      </tr>
  </tbody>
</table>
<p>Firebase accepts only mobile SDK sources, and only in <code>device</code> mode — the SDK loads Firebase in the app, and no events pass through RudderStack&rsquo;s servers. It doesn&rsquo;t accept <code>web</code>, <code>cordova</code>, or <code>cloud</code> sources. See <a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/firebase/#add-device-mode-integration" >Add device mode integration</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="connect-a-source">Connect a source</h2><p>An event stream connection to this destination is checked against two rules at <code>validate</code> time.</p>
<p><strong>The source&rsquo;s type must be supported.</strong> Firebase accepts the types the mobile SDK sources resolve to. A JavaScript source resolves to <code>web</code>, a Cordova source to <code>cordova</code>, and webhook and server-side SDK sources to <code>cloud</code> — none of which Firebase accepts — and reports, for example:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;firebase-prod&#39; (type &#39;firebase&#39;) does not support source &#39;my-web-app&#39;:
source type &#39;web&#39; is not among supported source types: android, android_kotlin, ios, ios_swift, unity, react_native, flutter</code></pre></div>
</div>
<p><strong>The destination config must carry a <code>connection_mode</code> entry for that source type.</strong> This lives on the destination spec, not on the <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-connections/" >connection spec</a>. Without it:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">destination &#39;firebase-prod&#39; config has no &#39;connection_mode&#39; entry for source type &#39;android&#39;</code></pre></div>
</div>
<p>Firebase needs no additional config keys to connect a source of any supported type.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="secrets">Secrets</h2><p>Firebase has no secret keys, and no credentials in its config at all. The app authenticates to Firebase with the configuration file it bundles.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="changes-by-release">Changes by release</h2>
<p>No changes since this type became available.</p>
<p>For changes across every destination type, see <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/changes/" >Destination Type Changes by Release</a>.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="see-more">See more</h2><ul>
<li><a href="https://www.rudderstack.com/docs/destinations/streaming-destinations/firebase/" >Firebase Destination</a> for adding the Firebase SDK to your app, and the event and property mappings</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/destination-types/" >Destination Type Reference for Rudder CLI</a> for the rules shared across destination types</li>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-destinations/" >Destination YAML Reference</a> for the spec envelope</li>
</ul>

