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

# Google Sheets

> Mount Google Sheets spreadsheets as Mirage files from Node or the browser.

`GSheetsVFS` exposes Google Sheets as `.gsheet.json` and CSV-style files. Reads return cell values; writes update ranges via the Sheets API.

Setup steps for OAuth credentials live at [Google Workspace Credentials](/home/setup/google).

## Node

```bash theme={null}
pnpm add @struktoai/mirage-node
```

```ts theme={null}
import { GSheetsVFS, MountMode, Workspace } from '@struktoai/mirage-node'

const sheets = new GSheetsVFS({
  clientId: process.env.GOOGLE_CLIENT_ID!,
  clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
  refreshToken: process.env.GOOGLE_REFRESH_TOKEN!,
})

const ws = new Workspace({ '/sheets': sheets }, { mode: MountMode.READ })
await ws.shell('ls /sheets/owned/')
```

## Browser

```bash theme={null}
pnpm add @struktoai/mirage-browser
```

```ts theme={null}
import { GSheetsVFS, MountMode, Workspace } from '@struktoai/mirage-browser'

const sheets = new GSheetsVFS({
  clientId: GOOGLE_CLIENT_ID,
  clientSecret: GOOGLE_CLIENT_SECRET,
  refreshToken: localStorage.getItem('gsheets.refresh_token')!,
})
```

## Config

| Field | Default | Notes |
| - | - | - |
| `clientId` | required | Google OAuth client ID. |
| `clientSecret` | required | Google OAuth client secret. Redacted in snapshots. |
| `refreshToken` | required | User's refresh token. Redacted in snapshots. |
| `refreshFn` | built-in | Optional override for the access-token refresh callback. |

## Mount mode

`read`, partial write (range updates).

For the layout, sheet/tab structure, and write semantics see the [Python Sheets docs](/python/vfs/gsheets).


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