Skip to content

docs(gcp): add credentials DX examples - #475

Open
Mkassabov wants to merge 2 commits into
mainfrom
feat/gcp-sdk-dx
Open

docs(gcp): add credentials DX examples#475
Mkassabov wants to merge 2 commits into
mainfrom
feat/gcp-sdk-dx

Conversation

@Mkassabov

Copy link
Copy Markdown
Collaborator

GCP SDK credentials DX: env token and explicit token, then a distilled service call. No ADC and no service-account signing — mint the bearer outside the SDK (gcloud auth print-access-token).

DX

import * as storage from "@distilled.cloud/gcp/storage_v1";
import { CredentialsFromEnv } from "@distilled.cloud/gcp/Credentials";
import * as Effect from "effect/Effect";

const object = yield* storage
  .getObjects({ bucket: "my-bucket", object: "hello.txt" })
  .pipe(Effect.provide(CredentialsFromEnv));
import * as pubsub from "@distilled.cloud/gcp/pubsub_v1";
import { fromAccessToken } from "@distilled.cloud/gcp/Credentials";
import * as Effect from "effect/Effect";

const published = yield* pubsub
  .publishProjectsTopics({
    topic: "projects/my-project/topics/events",
    body: { messages: [{ data: btoa("hello") }] },
  })
  .pipe(
    Effect.provide(
      fromAccessToken({
        accessToken: process.env.GOOGLE_ACCESS_TOKEN!,
        project: "my-project",
      }),
    ),
  );

Services stay on @distilled.cloud/gcp/<name>_<version> (storage_v1, pubsub_v1, compute_v1, …). The package root exports credentials, protocol, and errors only.

@alchemy-version-bot

alchemy-version-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

Distilled

@distilled.cloud/core

bun add https://pkg.ing/@distilled.cloud/core/cecf35f

@distilled.cloud/gcp

bun add https://pkg.ing/@distilled.cloud/gcp/cecf35f

Show CredentialsFromEnv and fromAccessToken against storage_v1 / pubsub_v1 so the GCP SDK documents the same call shape alchemy uses.
Mkassabov added a commit to alchemy-run/alchemy that referenced this pull request Aug 24, 2026
Point the submodule at alchemy-run/distilled#475 so Alchemy can consume the GCP credentials DX without waiting for merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant