opencode-antigravity-auth-updated

raw JSON →
1.6.2 verified Sat Apr 25 auth: no javascript

Google Antigravity IDE OAuth auth plugin for Opencode, providing access to Gemini 3 Pro and Claude 4.6 using Google credentials. Current stable version is 1.6.2, released with fixes for proper-lockfile interop and Node.js 25 compatibility. The plugin is updated frequently with beta releases introducing new features like TUI v2 and opt-in Claude 1M beta head. Key differentiators: offers access to latest AI models via Google Antigravity IDE, includes account rotation and quota management, and ships TypeScript types.

error ERR_REQUIRE_ESM
cause Using require() on an ESM-only package after v1.6.1.
fix
Use import syntax or rename file to .mjs.
error TypeError: AntigravityAuthProvider is not a constructor
cause AntigravityAuthProvider is a named export, not default, so default import returns undefined.
fix
Change import to: import { AntigravityAuthProvider } from 'opencode-antigravity-auth-updated'
error Cannot find module 'opencode-antigravity-auth-updated'
cause Package not installed or cache is stale.
fix
Run 'npm install opencode-antigravity-auth-updated' and clear cache: rm -rf ~/.cache/opencode/node_modules
breaking Node.js 20+ is required; older versions will throw a runtime error due to ESM imports and missing APIs.
fix Upgrade Node.js to version 20 or later (e.g., via nvm).
breaking ESM-only since v1.6.1; CommonJS require() will fail with 'ERR_REQUIRE_ESM'.
fix Switch to ESM (type: 'module' in package.json or .mjs extension) and use import syntax.
deprecated The 'quotaCheck' option is deprecated since v1.6.0; use 'interactiveQuotaCheck' instead.
fix Replace quotaCheck with interactiveQuotaCheck in configuration.
gotcha GitHub Actions auto-triggers may cause multiple builds; cache clearing is needed after version updates.
fix Clear cache with 'rm -rf ~/.cache/opencode/node_modules ~/.cache/opencode/bun.lock' after updating.
gotcha TypeScript types are shipped but require typescript^5 as peer dependency; missing peer dep may cause type errors.
fix Install typescript@^5 as a devDependency.
npm install opencode-antigravity-auth-updated
yarn add opencode-antigravity-auth-updated
pnpm add opencode-antigravity-auth-updated

Shows how to import and instantiate the AntigravityAuth class with OAuth credentials, then trigger authentication.

import AntigravityAuth from 'opencode-antigravity-auth-updated';

const auth = new AntigravityAuth({
  clientId: process.env.GOOGLE_CLIENT_ID ?? '',
  clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '',
  redirectUri: 'http://localhost:3000/callback'
});

async function main() {
  try {
    const token = await auth.authenticate();
    console.log('Authentication successful, token:', token);
  } catch (error) {
    console.error('Authentication failed:', error);
  }
}

main();