> ## 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 Drive file metadata

> Mount Google Drive file metadata.

Follow the [REST app guide](https://docs.bijection.com/integrations/native-rest.md#mount-and-bind).
Use `providerEndpoint` from `@bijectionhq/app-rest` to bind the collection,
and supply Google OAuth `drive.metadata.readonly` or `drive.readonly`.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
const provider = providerEndpoint(
  "google-drive/files.metadata.observations",
  "https://www.googleapis.com",
  "/drive/v3/files",
  auth,
  data,
);
```

Pass `provider` as `receivers.provider`, with the same label to the binder and as the app's `data`. Grant the app's `operator` role, then call
`source.initialize` with this profile.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{ profile: { mode: "provider", provider: "google-drive/files.metadata.observations", limit: 25 } }
```

File ID keys. The optional `selection` is one shared-drive ID. Without it the feed uses the authenticated user's corpus. The feed stores metadata, including an observed trash flag. Missing files leave prior observations in place. A terminal page ends the sweep, and the next poll starts a new one. File bodies and Drive change tracking are outside this mode.

Up to 100 rows and 36 KiB per response. The bundled parser is required. Pages publish rows and their next
position together. Use [source health and controls](https://docs.bijection.com/integrations/native-rest.md#feed-contracts)
to review failures and recover the feed.

[Provider API reference](https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list)

## Write entries

Follow the [native write app guide](https://docs.bijection.com/integrations/native-rest.md#native-provider-writes). Bind `providerWriter("google-drive.entries.create-update-delete", { endpoint: "https://www.googleapis.com", auth }, data)` and pass it as `receivers.writers["google-drive.entries.create-update-delete"]`. Seal a Drive OAuth credential with access limited to the intended files or shared drive. Create takes `{ name, parents }` and always creates a folder. Update takes `name` or `description` for an exact file or folder ID. HTTP 200 must return that ID. Delete sets `trashed: true` on the requested entry and requires it in the HTTP 200 reply. Trashing a folder also affects access to its descendants.

The writer records its evidence under the app's `data` label. Commands take up to 24 KiB of JSON and carry no read cursor.

[Provider write API](https://developers.google.com/workspace/drive/api/reference/rest/v3/files)

## File permissions and revisions

Mount `@bijectionhq/app-rest` with `providerEndpoint` at
`https://www.googleapis.com`. Pass one protected label to the receiver binder and as the app's `data`. Seal a bearer or OAuth2 credential
with Drive metadata access to the file. Use one mount per file and mode.

| Mode | Installed path | Record key |
| - | - | - |
| `google-drive.file.permissions.observations` | `/drive/v3/files/FILE_ID/permissions` | Permission ID |
| `google-drive.file.revisions.observations` | `/drive/v3/files/FILE_ID/revisions` | Revision ID |

Initialize with the corresponding `profile.provider` and a `limit` of 1–100.
The inline response bound is 36 KiB. `nextPageToken` continues the same
file listing and the next poll after a terminal page starts over.
Missing entries remain published. A permission can describe a deleted
account. Drive's revision list can omit revisions shown in its UI.

[Permissions](https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/list) ·
[Revisions](https://developers.google.com/workspace/drive/api/reference/rest/v3/revisions/list)


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