Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://app.buildagenta.com/api-keys> |
| `A2ANET_API_URL` | `https://app.buildagenta.com/api/v1` |
| `AGENTA_API_KEY` | A standard user API key, minted at <https://app.buildagenta.com/api-keys> |
| `AGENTA_API_URL` | `https://app.buildagenta.com/api/v1` |

## Your Customer Sign-In URL

Expand Down
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export async function redeemLinkToken(
): Promise<ConnectResult> {
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 }),
Expand Down Expand Up @@ -100,10 +100,10 @@ export async function redeemLinkToken(
export async function previewLinkToken(linkToken: string): Promise<LinkDescription | null> {
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 }),
Expand Down
4 changes: 2 additions & 2 deletions tests/connect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
Loading