npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anthropic-ai/google-cloud-sdk

v0.0.6

Published

The official TypeScript library for Claude Platform on Google Cloud

Readme

Claude SDK for Claude Platform on Google Cloud

NPM version

This library provides convenient access to Claude Platform on Google Cloud — the first-party Claude API served through Google Cloud. It exposes the full Anthropic API surface and authenticates with a Google bearer token.

For the direct Claude API at api.anthropic.com, see @anthropic-ai/sdk. For the :rawPredict publisher-model API, see @anthropic-ai/vertex-sdk.

Installation

npm install @anthropic-ai/google-cloud-sdk

Usage

import { AnthropicGoogleCloud } from '@anthropic-ai/google-cloud-sdk';

const client = new AnthropicGoogleCloud({
  project: 'my-gcp-project', // or ANTHROPIC_GOOGLE_CLOUD_PROJECT
  workspaceId: 'wrkspc_...', // or ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID
});

const message = await client.messages.create({
  model: 'claude-haiku-4-5',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello, Claude!' }],
});

console.log(message.content);

See examples/ for runnable basic and streaming examples.

Configuration

| Option | Environment variable | Notes | | ------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | project | ANTHROPIC_GOOGLE_CLOUD_PROJECT | GCP project id, used to derive the base URL. When neither is set (and no baseURL is given), it is resolved lazily from your Google credentials at or before the first request. | | location | ANTHROPIC_GOOGLE_CLOUD_LOCATION | GCP location. Optional — defaults to global. | | workspaceId | ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID | Required unless skipAuth is set with an explicit baseURL. | | baseURL | ANTHROPIC_GOOGLE_CLOUD_BASE_URL | Overrides the base URL derived from project + location + workspaceId. | | skipAuth | — | Skips the bearer token, for gateways that authenticate upstream. A workspaceId is still needed unless baseURL is explicit. |

When the project is resolved lazily, await client.ready to fail fast on misconfiguration instead of waiting for the first request.

Authentication

Authentication uses a Google bearer token, resolved by precedence — an explicit bearerTokenProvider, then a google-auth-library googleAuth / authClient, then Application Default Credentials.

This client never uses the base SDK's Anthropic credential sources: ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, and profile config files are all ignored, and the only Authorization header it sends is the Google bearer token.

Application Default Credentials

Set up ADC (e.g. gcloud auth application-default login) and the client fetches and refreshes a bearer token for you, no auth options needed.

Custom Google credentials

Pass a GoogleAuth or AuthClient to override the default credential chain (for example to use impersonated credentials):

import { AnthropicGoogleCloud } from '@anthropic-ai/google-cloud-sdk';
import { GoogleAuth } from 'google-auth-library';

const client = new AnthropicGoogleCloud({
  project: 'my-gcp-project',
  workspaceId: 'wrkspc_...',
  googleAuth: new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' }),
});

Bearer token provider

If you already mint Google access tokens yourself, supply a bearerTokenProvider. It is invoked on every request and takes precedence over googleAuth / authClient and ADC:

const client = new AnthropicGoogleCloud({
  project: 'my-gcp-project',
  workspaceId: 'wrkspc_...',
  bearerTokenProvider: async () => myTokenSource.getAccessToken(),
});

Pre-authenticated proxy

If a gateway or proxy authenticates upstream on your behalf, set skipAuth to skip the bearer token (with an explicit baseURL, no workspaceId is needed):

const client = new AnthropicGoogleCloud({
  baseURL: 'https://my-proxy.example.com',
  skipAuth: true,
});