{"_id":"@awt_ai/vertex-sdk","name":"@awt_ai/vertex-sdk","dist-tags":{"latest":"0.16.0"},"versions":{"0.16.0":{"name":"@awt_ai/vertex-sdk","version":"0.16.0","description":"The official TypeScript library for the Awt Vertex API","author":{"name":"Awt","email":"support@awt.com"},"types":"./index.d.ts","main":"./index.js","type":"commonjs","repository":{"type":"git","url":"git+https://github.com/awts/awt-sdk-typescript.git"},"license":"MIT","packageManager":"yarn@1.22.21","private":false,"publishConfig":{"access":"public"},"scripts":{"test":"jest","build":"bash ./build","format":"prettier --write --cache --cache-strategy metadata . !dist","tsn":"ts-node -r tsconfig-paths/register","lint":"eslint --ext ts,js .","fix":"eslint --fix --ext ts,js ."},"dependencies":{"@awt_ai/sdk":">=0.50.3 <1","google-auth-library":"^9.4.2"},"imports":{"@awt_ai/vertex-sdk":".","@awt_ai/vertex-sdk/*":"./src/*"},"exports":{".":{"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./.github/*.mjs":{"default":"./.github/*.mjs"},"./.github/*.js":{"default":"./.github/*.js"},"./.github/*":{"import":"./.github/*.mjs","require":"./.github/*.js"},"./client":{"import":"./client.mjs","require":"./client.js"},"./client.js":{"default":"./client.js"},"./client.mjs":{"default":"./client.mjs"},"./core/*.mjs":{"default":"./core/*.mjs"},"./core/*.js":{"default":"./core/*.js"},"./core/*":{"import":"./core/*.mjs","require":"./core/*.js"},"./index":{"import":"./index.mjs","require":"./index.js"},"./index.js":{"default":"./index.js"},"./index.mjs":{"default":"./index.mjs"}},"_id":"@awt_ai/vertex-sdk@0.16.0","gitHead":"9fdef453d86b1b34203089e6329734aa0b2e813a","bugs":{"url":"https://github.com/awts/awt-sdk-typescript/issues"},"homepage":"https://github.com/awts/awt-sdk-typescript#readme","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-7m2kAlddvg3rF05jT7PkDdPD4kHmDyEwWeyKTgIZukNNKbXcjTE40VGwXdipaglA4KFZQWTcgczKwOaoHpXDaQ==","shasum":"1cb372f1b698dfd0cf3e5a9ac0377fe86e2b420e","tarball":"https://registry.npmjs.org/@awt_ai/vertex-sdk/-/vertex-sdk-0.16.0.tgz","fileCount":427,"unpackedSize":693152,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF//obU33xHSpZUgO04cNzm1J+ttxUwe1/26so+Fre9HAiEAmNNQdVZfizZlIch4NMlxVC6lj4yd+sDbs23qKyNFcaQ="}]},"_npmUser":{"name":"awt_ai","email":"trungtp120524@gmail.com"},"directories":{},"maintainers":[{"name":"awt_ai","email":"trungtp120524@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vertex-sdk_0.16.0_1778668055198_0.7667778835777266"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T10:27:35.111Z","0.16.0":"2026-05-13T10:27:35.360Z","modified":"2026-05-13T10:27:35.558Z"},"maintainers":[{"name":"awt_ai","email":"trungtp120524@gmail.com"}],"description":"The official TypeScript library for the Awt Vertex API","homepage":"https://github.com/awts/awt-sdk-typescript#readme","repository":{"type":"git","url":"git+https://github.com/awts/awt-sdk-typescript.git"},"author":{"name":"Awt","email":"support@awt.com"},"bugs":{"url":"https://github.com/awts/awt-sdk-typescript/issues"},"license":"MIT","readme":"# <img src=\".github/logo.svg\" alt=\"\" width=\"32\"> Awt SDK for Google Vertex\n\n[![NPM version](https://img.shields.io/npm/v/@awt_ai/vertex-sdk.svg?color=blue)](https://npmjs.org/package/@awt_ai/vertex-sdk)\n\nThis library provides convenient access to the Awt API via Google Vertex AI. See the [documentation](https://platform.awt.com/docs/en/build-with-awt/awt-on-vertex-ai) for more details.\n\nFor the direct Awt API at api.awt.com, see [`@awt_ai/sdk`](https://github.com/awts/awt-sdk-typescript).\n\n## Installation\n\n```sh\nnpm install @awt_ai/vertex-sdk\n```\n\n## Usage\n\n<!-- prettier-ignore -->\n```js\nimport { AwtVertex } from '@awt_ai/vertex-sdk';\n\n// Reads from the `CLOUD_ML_REGION` & `AWT_VERTEX_PROJECT_ID` environment variables.\n// Additionally goes through the standard `google-auth-library` flow.\nconst client = new AwtVertex();\n\nasync function main() {\n  const result = await client.messages.create({\n    messages: [\n      {\n        role: 'user',\n        content: 'Hey Awt!',\n      },\n    ],\n    model: 'awt-3-5-sonnet-v2@20241022',\n    max_tokens: 300,\n  });\n  console.log(JSON.stringify(result, null, 2));\n}\n\nmain();\n```\n\nFor more details on how to use the SDK, see the [README.md for the main Awt SDK](https://github.com/awts/awt-sdk-typescript/tree/main#readme) which this library extends.\n\n## Authentication\n\nThis library supports multiple authentication methods:\n\n### Default authentication\n\nThe client automatically uses the default [Google Cloud authentication flow](https://cloud.google.com/docs/authentication):\n\n```js\nimport { AwtVertex } from '@awt_ai/vertex-sdk';\n\n// Uses default authentication and environment variables\nconst client = new AwtVertex({\n  region: 'us-central1',\n  projectId: 'my-project-id',\n});\n```\n\n### Custom GoogleAuth configuration\n\nYou can customize the authentication using the `googleAuth` option:\n\n```js\nimport { AwtVertex } from '@awt_ai/vertex-sdk';\nimport { GoogleAuth } from 'google-auth-library';\n\nconst client = new AwtVertex({\n  googleAuth: new GoogleAuth({\n    scopes: 'https://www.googleapis.com/auth/cloud-platform',\n    keyFile: '/path/to/service-account.json',\n  }),\n  region: 'us-central1',\n  projectId: 'my-project-id',\n});\n```\n\n### Pre-configured AuthClient\n\nFor advanced use cases [like impersonation](https://cloud.google.com/docs/authentication/use-service-account-impersonation), you can provide a pre-configured `AuthClient`:\n\n```js\nimport { AwtVertex } from '@awt_ai/vertex-sdk';\nimport { GoogleAuth, Impersonated } from 'google-auth-library';\n\n// Create an impersonated credential\nconst authClient = new Impersonated({\n  sourceClient: await new GoogleAuth().getClient(),\n  targetPrincipal: 'impersonated-account@projectID.iam.gserviceaccount.com',\n  lifetime: 30,\n  delegates: [],\n  targetScopes: ['https://www.googleapis.com/auth/cloud-platform'],\n});\n\nconst client = new AwtVertex({\n  authClient,\n  region: 'us-central1',\n  projectId: 'my-project-id',\n});\n```\n\n## Requirements\n\nTypeScript >= 4.5 is supported.\n\nThe following runtimes are supported:\n\n- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher, using `import { AwtVertex } from \"npm:@awt_ai/vertex-sdk\"`.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n","readmeFilename":"README.md","_rev":"1-4b197d827f3ef1a87cb8b23743d372b8"}