Skip to content

Instantly share code, notes, and snippets.

@korakot
Created July 31, 2024 11:56
Show Gist options
  • Save korakot/98e82ac5aaaf0dc5ad06c64aeebb936c to your computer and use it in GitHub Desktop.
Save korakot/98e82ac5aaaf0dc5ad06c64aeebb936c to your computer and use it in GitHub Desktop.
2 ways to pass in Google credentials from Service Account info
let cred = JSON.parse(Deno.env.get("GOOGLE_APPLICATION_CREDENTIALS"));
// Big Query Style
export let bq = new BigQuery({ projectId, credentials: cred });
// Vertex Style
let vertex_ai = new VertexAI({ project: "kora-id", location: "us-central1",
googleAuthOptions: { credentials: cred } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment