-
-
Notifications
You must be signed in to change notification settings - Fork 2
plugin google
Google APIs proxy. Manages OAuth2 tokens with AES-256-GCM encryption and automatic refresh. Exposes unified endpoints for Gmail, Drive, Calendar, Sheets, Contacts, GCP, and Gemini probes. Pro plugin (ɳClaw bundle).
Requires: ɳClaw bundle or ɳSelf+ subscription.
nself license set <your-license-key>
nself plugin install googleProvides OAuth2 token management and proxy REST APIs for all major Google services. Handles automatic token refresh so your application never manages expiry. All tokens are stored encrypted with AES-256-GCM. The service exposes Gmail, Drive, Calendar, Sheets, Contacts, and GCP endpoints under a single authenticated proxy on port 9003.
- Create a project at console.cloud.google.com.
- Enable APIs: Gmail API, Drive API, Calendar API, Sheets API, People API.
- Create OAuth 2.0 credentials (Web application type).
- Set the authorised redirect URI to
https://<your-domain>/google/oauth/callback. - Copy the Client ID and Client Secret into the env vars below.
| Variable | Required | Description |
|---|---|---|
GOOGLE_CLIENT_ID |
Yes | OAuth2 client ID from Google Console |
GOOGLE_CLIENT_SECRET |
Yes | OAuth2 client secret |
GOOGLE_REDIRECT_URI |
Yes | Authorised redirect URI (must match Console exactly) |
GOOGLE_PLUGIN_PORT |
No | HTTP server port (default: 9003) |
GOOGLE_ENCRYPTION_KEY |
Yes | AES-256-GCM key, 32 bytes hex-encoded, for token encryption |
NSELF_DB_URL |
Yes | PostgreSQL connection string |
NSELF_LICENSE_KEY |
Yes | License key (validated against ping.nself.org) |
| Method | Path | Description |
|---|---|---|
GET |
/google/oauth/start |
Initiate OAuth2 authorisation flow |
GET |
/google/oauth/callback |
OAuth2 callback (set as redirect URI in Console) |
POST |
/google/oauth/revoke |
Revoke tokens and remove the connected account |
GET |
/google/accounts |
List all connected Google accounts |
GET |
/google/accounts/:id |
Get a specific account |
DELETE |
/google/accounts/:id |
Disconnect account and delete tokens |
| Method | Path | Description |
|---|---|---|
GET |
/google/gmail/messages |
List messages (params: q, maxResults, pageToken) |
GET |
/google/gmail/messages/:id |
Get a single message with body and headers |
POST |
/google/gmail/send |
Send an email (structured JSON or raw RFC 2822) |
GET |
/google/gmail/labels |
List all labels |
POST |
/google/gmail/watch |
Subscribe to Gmail push notifications |
DELETE |
/google/gmail/watch |
Unsubscribe from push notifications |
| Method | Path | Description |
|---|---|---|
GET |
/google/drive/files |
List files (params: q, fields, pageToken) |
GET |
/google/drive/files/:id |
Get file metadata |
GET |
/google/drive/files/:id/content |
Download file content |
POST |
/google/drive/files |
Upload a file (multipart) |
DELETE |
/google/drive/files/:id |
Move file to trash |
POST |
/google/drive/rag |
Index a Drive file for RAG retrieval |
| Method | Path | Description |
|---|---|---|
GET |
/google/calendar/events |
List events (params: timeMin, timeMax, calendarId) |
GET |
/google/calendar/events/:id |
Get a single event |
POST |
/google/calendar/events |
Create a calendar event |
PUT |
/google/calendar/events/:id |
Update a calendar event |
DELETE |
/google/calendar/events/:id |
Delete a calendar event |
GET |
/google/calendar/calendars |
List all calendars for the connected account |
| Method | Path | Description |
|---|---|---|
GET |
/google/sheets/:id |
Get spreadsheet metadata |
GET |
/google/sheets/:id/values/:range |
Read cell values (A1 notation) |
PUT |
/google/sheets/:id/values/:range |
Write cell values |
POST |
/google/sheets/:id/batchUpdate |
Batch spreadsheet operations |
| Method | Path | Description |
|---|---|---|
GET |
/google/contacts |
List contacts |
GET |
/google/contacts/:resourceName |
Get a contact by resource name |
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check (readiness probe) |
POST |
/google/internal/token |
Internal token exchange (service-to-service) |
GET |
/google/internal/tools |
Tool listing for ɳClaw AI integration |
POST |
/google/gcp/probe |
GCP project metadata probe |
POST |
/google/gemini/probe |
Gemini AI availability probe |
| Table | Purpose |
|---|---|
np_google_accounts |
Connected Google accounts per user (source_account_id isolated) |
np_google_tokens |
AES-256-GCM encrypted OAuth tokens (linked via FK to accounts) |
np_google_audit_log |
API call audit trail: surface, action, status, timestamp |
All np_google_accounts and np_google_audit_log rows carry source_account_id for
multi-app isolation per the nSelf Multi-Tenant Convention Wall (Convention A).
Hasura metadata applies source_account_id = X-Hasura-Source-Account-Id row filters on
np_google_accounts and np_google_audit_log. Token rows are isolated transitively via
the account_id FK on np_google_tokens.
All outbound HTTP requests target googleapis.com only. The redirect URI is validated
server-side against GOOGLE_REDIRECT_URI. User-supplied URLs are never followed as
outbound targets. There are no user-overridable outbound URL fields.
location /google/ {
proxy_pass http://plugin-google:9003/google/;
}| Port | Protocol | Purpose |
|---|---|---|
9003 |
HTTP | plugin-google REST API |
ɳSelf CLI v1.0.9. MIT licensed. Docs CC BY 4.0.
GitHub · Issues · Discussions · nself.org · docs.nself.org
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog · cmd-dogfood
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-security · cmd-secrets · cmd-waf
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-ɳClaw, AI Assistant
- Feature-ɳChat, Messaging
- Feature-ɳTV, Media Player
- Feature-ɳFamily, Family Social
- Feature-ɳCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- nself-ai-gateway
- nself-ai-cc
- nself-ai-mcp
- plugin-analytics
- plugin-auth
- plugin-backup-pro
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-cron-pro
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-donorbox-pro
- plugin-entitlements
- plugin-epg
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-notify-pro
- plugin-object-storage
- plugin-observability
- plugin-paypal-pro
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-recording
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-shopify-pro
- plugin-social
- plugin-sports
- plugin-stream-gateway
- plugin-streaming
- plugin-stripe-pro
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
Reference
- API-Reference
- reference-error-codes, Error Codes
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions