Select spec version:

BigQuery Stream Destination Config Reference Beta

Complete Rudder CLI reference for the BigQuery Stream destination config keys, deduplication, source types, and secrets.
Available Plans
  • free
  • growth
  • enterprise

BigQuery Stream streams events into an existing BigQuery table through Google’s streaming insert API, so rows are queryable within seconds rather than after a scheduled load.

In a BigQuery Stream destination spec:

  • type: bqstream
  • definition_version: 1

Sample configuration

yaml
version: rudder/v1
kind: destination
metadata:
  name: bigquery-stream-prod
spec:
  id: bigquery-stream-prod
  display_name: BigQuery Stream Production
  type: bqstream
  definition_version: 1
  enabled: true
  config:
    project_id: acme-analytics
    dataset_id: product_events
    table_id: product_inserts
    insert_id: productId
    credentials: "{{ .BQSTREAM_CREDENTIALS }}"

    connection_mode:
      web: cloud
      cloud: cloud
    consent_management:
      web:
        - provider: oneTrust
          consents:
            - analytics

The above example deduplicates on the productId event property. Leave insert_id out to stream without deduplication — see Deduplication.

Config keys

config accepts only the keys listed below. The shared config key rules cover unknown keys, defaults, and immutability.

BigQuery Stream accepts only track events, and RudderStack forwards each event’s properties without fetching or checking the table schema. Make sure the track payload matches the columns of the table named in table_id — see Send events to BigQuery Stream.

Table

project_id

Required

Type: string

Description: GCP project ID that holds the dataset.

dataset_id

Required

Type: string

Description: ID of the dataset, within project_id, that holds the table.

table_id

Required

Type: string

Description: ID of the table RudderStack streams events into. The table must already exist.

Deduplication

insert_id

Type: string

Description: Name of the event property whose value BigQuery uses as the insertId to deduplicate rows — for example productId. It names the property, not the value.

Notes:

  • The property’s value must be a number or a string.
  • Deduplication applies only when the value is present in the event’s properties.

To pick the property per event, use a template with a fallback:

yaml
insert_id: '{{ message.uniqueId || "productId" }}'

See Configure insertId dynamically for how each case resolves.

Authentication

credentials

RequiredSecret

Type: string

Description: Contents of the JSON key file for a GCP service account that can insert rows into the table.

Supply it as a {{ .VAR }} reference rather than a literal — see Secrets.

See Create a service account for the steps.

Per-source keys

Both keys are objects keyed by the local source type — the tokens listed under Source types. A key naming a source type this destination doesn’t support fails validation.

connection_mode

Type: object

Description: Maps each source type you connect to the mode its events reach BigQuery in, using the modes in Source types.

Notes:

yaml
connection_mode:
  web: cloud
  cloud: cloud

Source types

BigQuery Stream accepts events from these source types in the mentioned connection modes:

Source typeConnection mode
androidcloud
android_kotlincloud
ioscloud
ios_swiftcloud
webcloud
unitycloud
react_nativecloud
fluttercloud
cordovacloud
cloudcloud

Every source type is cloud only — events reach the table from RudderStack’s servers, never in device mode.

The dashboard additionally offers BigQuery Stream to AMP, Shopify, and Reverse ETL sources. Rudder CLI doesn’t manage those connections, so amp, shopify, and warehouse are invalid here.

Connect a source

An event stream connection to this destination is checked against two rules at validate time.

The source’s type must be supported. A source’s type resolves to one of the tokens above before the check — a JavaScript source resolves to web, and webhook and server-side SDK sources resolve to cloud. An unsupported type reports:

destination 'bigquery-stream-prod' (type 'bqstream') does not support source 'my-source':
source type 'amp' is not among supported source types: android, android_kotlin, ...

The destination config must carry a connection_mode entry for that source type. This lives on the destination spec, not on the connection spec. Without it:

destination 'bigquery-stream-prod' config has no 'connection_mode' entry for source type 'web'

BigQuery Stream needs no additional config keys to connect a source of any type.

Secrets

credentials is the only secret key. Write it as a {{ .VAR }} reference and supply the value at apply time:

yaml
config:
  credentials: "{{ .BQSTREAM_CREDENTIALS }}"
bash
export RUDDER_BQSTREAM_CREDENTIALS="$(cat service-account.json)"
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml

Note that:

  • The YAML that rudder-cli import writes may or may not include secret keys. Before you apply, make sure every secret key your configuration needs is present and populated through variable substitution.

See How to Use Variable Substitution in Rudder CLI.

See more

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.