From eafd37f537a4a90af4d3b268c290dfdc21e5a5b6 Mon Sep 17 00:00:00 2001 From: Ben Clarke Date: Mon, 2 Nov 2026 21:56:56 +0000 Subject: [PATCH] chore: rename env vars to AGENTA_* - Read the API key and URL from `AGENTA_API_KEY` and `AGENTA_API_URL` - Rename the package to `connect-example` to match the repo Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- README.md | 6 +++--- bun.lock | 2 +- package.json | 2 +- src/connect.ts | 8 ++++---- tests/connect.test.ts | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index e9b40cd..62a471d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,7 +29,7 @@ so it can name the chat account before anyone clicks Connect. ## 2. Add the environment variables -`A2ANET_API_KEY` and `A2ANET_API_URL`, as described in `README.md`. Server-side +`AGENTA_API_KEY` and `AGENTA_API_URL`, as described in `README.md`. Server-side only. In a framework that prefixes public variables (`NEXT_PUBLIC_`, `VITE_`), neither takes that prefix. diff --git a/README.md b/README.md index c79b985..a6cfdfb 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ Agenta never sees the customer's credentials. ## Environment -Server side only — an `A2ANET_API_KEY` that reaches the browser is a leaked +Server side only — an `AGENTA_API_KEY` that reaches the browser is a leaked credential: | Variable | What it is | | ---------------- | ------------------------------------------------------------------- | -| `A2ANET_API_KEY` | A standard user API key, minted at | -| `A2ANET_API_URL` | `https://app.buildagenta.com/api/v1` | +| `AGENTA_API_KEY` | A standard user API key, minted at | +| `AGENTA_API_URL` | `https://app.buildagenta.com/api/v1` | ## Your Customer Sign-In URL diff --git a/bun.lock b/bun.lock index f3edb5e..15e472d 100644 --- a/bun.lock +++ b/bun.lock @@ -3,7 +3,7 @@ "configVersion": 1, "workspaces": { "": { - "name": "a2anet-connect-example", + "name": "connect-example", "devDependencies": { "@biomejs/biome": "^1.9.0", "@types/bun": "latest", diff --git a/package.json b/package.json index 72d8ad0..de560f8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "a2anet-connect-example", + "name": "connect-example", "version": "0.1.0", "private": true, "description": "An example of the /connect endpoint that links Slack and Teams users to your own customers", diff --git a/src/connect.ts b/src/connect.ts index 37f35fc..35d3697 100644 --- a/src/connect.ts +++ b/src/connect.ts @@ -65,10 +65,10 @@ export async function redeemLinkToken( ): Promise { let response: Response; try { - response = await fetch(`${env("A2ANET_API_URL")}/customer-links`, { + response = await fetch(`${env("AGENTA_API_URL")}/customer-links`, { method: "POST", headers: { - Authorization: `Bearer ${env("A2ANET_API_KEY")}`, + Authorization: `Bearer ${env("AGENTA_API_KEY")}`, "Content-Type": "application/json", }, body: JSON.stringify({ linkToken, customerId, ...values }), @@ -100,10 +100,10 @@ export async function redeemLinkToken( export async function previewLinkToken(linkToken: string): Promise { let response: Response; try { - response = await fetch(`${env("A2ANET_API_URL")}/customer-links/preview`, { + response = await fetch(`${env("AGENTA_API_URL")}/customer-links/preview`, { method: "POST", headers: { - Authorization: `Bearer ${env("A2ANET_API_KEY")}`, + Authorization: `Bearer ${env("AGENTA_API_KEY")}`, "Content-Type": "application/json", }, body: JSON.stringify({ linkToken }), diff --git a/tests/connect.test.ts b/tests/connect.test.ts index b97dfa9..0cf55b3 100644 --- a/tests/connect.test.ts +++ b/tests/connect.test.ts @@ -37,8 +37,8 @@ const post = (body: unknown): Request => }); beforeEach(() => { - process.env.A2ANET_API_URL = "https://app.buildagenta.com/api/v1"; - process.env.A2ANET_API_KEY = "a2anet_test"; + process.env.AGENTA_API_URL = "https://app.buildagenta.com/api/v1"; + process.env.AGENTA_API_KEY = "a2anet_test"; }); afterEach(() => {