> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud Bigtable

> Read a bounded Bigtable row range or capture table mutations.

Mount `@bijectionhq/app-documents` once per table and mode. This example
passes a protected label to the receiver binder and as the app's `data`. The
app's `operator` role clears it and allows its functions.

## Mount a Google stream

```ts bijection/app.ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { app, label, secret } from "@bijectionhq/bijection";
import documents, { bigtableStream } from "@bijectionhq/app-documents";

const items = label();
const credential = secret();
const provider = bigtableStream(credential, items);

export default app({ items, credential, provider, inventory: documents({ data: items, provider }) });
```

Grant `inventory.operator` and call `inventory.source.initialize` with the
row range:

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{
  selection: { mode: "bigtable.rows.range", terms: {
    table: "projects/my-project/instances/inventory/tables/items",
    appProfile: "reader",
    range: { start: "YQ==", end: "eg==" },
  } },
}
```

Read the rows with `inventory.documents.list` and `inventory.documents.get`,
and the source with `inventory.source.health` and `inventory.source.partitions`.

Set the JSON credential with `bijection secret set credential`. Its scope must
exactly match the mounted source. Rotate the access token by setting the
secret again.

```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{
  "accessToken": "GOOGLE_ACCESS_TOKEN",
  "scope": {
    "provider": "bigtable",
    "table": "projects/my-project/instances/inventory/tables/items",
    "appProfile": "reader"
  }
}
```

Grant the principal read access to the selected table. Use an access token
with a Bigtable data-read scope or `cloud-platform`. The receiver opens
one direct TLS connection to `bigtable.googleapis.com:443` under the
installation's permit and egress policy.

## Row range

Endpoints are canonical base64 bytes in a half-open range. Use `null`
for an unbounded endpoint. The receiver reads one row and assembles
its cells through Bigtable's commit marker. Keys may have up to 288 raw
bytes. Each row can carry up to 256 cells. Qualifiers and values use
base64, and cell timestamps use exact decimal microsecond strings.
After each accepted row, the next request starts strictly after its
key. An empty successful response completes the range. The range can
observe concurrent edits, and missing keys remain published.

## Change stream

Enable change streaming and select an app profile with single-cluster
routing. Grant the principal access to read changes on the table.
Initialize a separate mount with the same table credential and profile.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{
  selection: { mode: "bigtable.change-stream", terms: {
    table: "projects/my-project/instances/inventory/tables/items",
    appProfile: "reader",
    start: "2026-11-24T09:00:00Z",
  } },
}
```

The requested UTC start must be within Bigtable's change-stream retention.
The app discovers up to 64 initial partitions. It retains each partition's
continuation token and estimated low watermark with the accepted mutation.
A merge waits for continuation fragments that cover the whole child range
without overlap. A split closes the parent and records its children in the
same commit. The app admits up to eight fragments in one transition and
up to 1,024 partition announcements per generation. Continuation tokens
must each fit 2,048 bytes, and the partition dispatch must fit 4 KiB.

Each page contains at most one complete mutation event, keyed by a
digest of the partition position and mutation identity. The same mutation
can appear again at a new position after a reset or repartition. The record preserves the complete mutations as base64 Protobuf,
including explicit deletes and garbage-collection events as history.
Each exchange has a 20-second deadline and up to 48 KiB of answer data
within the action result's encoded bound. Failed or oversized answers
leave the position in place. A provider rejection of a retained
continuation can mark a gap. Inspect the labelled `source.health` and
`source.partitions` before authorizing a reset.

[Bigtable data RPCs](https://docs.cloud.google.com/bigtable/docs/reference/data/rpc/google.bigtable.v2)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.