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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Compatible with Claude Code and any agent framework that supports skill files.
| Environment Variable | Required | Default | Description |
|---------------------|----------|---------|-------------|
| `YOTTA_API_KEY` | Yes | — | Yotta Platform API key |
| `YOTTA_API_BASE_URL` | No | `https://api.test.yottalabs.ai` | API base URL |
| `YOTTA_API_BASE_URL` | No | `https://api.yottalabs.ai` | API base URL |

## Development

Expand Down
4 changes: 2 additions & 2 deletions src/api/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ describe("YottaClient", () => {
});

describe("request basics", () => {
it("sends correct Authorization header", async () => {
it("sends correct X-API-Key header", async () => {
const fetchMock = mockFetch([]);
const client = await freshClient();
await client.listPods();
expect(fetchMock).toHaveBeenCalledOnce();
const [, opts] = fetchMock.mock.calls[0];
expect(opts.headers.Authorization).toBe("Bearer test-api-key");
expect(opts.headers["X-API-Key"]).toBe("test-api-key");
});

it("prefixes paths with /v2", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class YottaClient {
const res = await fetch(url, {
method,
headers: {
Authorization: `Bearer ${this.apiKey}`,
"X-API-Key": this.apiKey,
"Content-Type": "application/json",
},
body: body ? JSON.stringify(body) : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("getConfig", () => {
delete process.env.YOTTA_API_BASE_URL;
const { getConfig } = await import("./config.js");
const config = getConfig();
expect(config.apiBaseUrl).toBe("https://api.test.yottalabs.ai");
expect(config.apiBaseUrl).toBe("https://api.yottalabs.ai");
});

it("uses custom base URL from env", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getConfig(): Config {
if (!apiKey) throw new Error("YOTTA_API_KEY environment variable is required");

_config = {
apiBaseUrl: (process.env.YOTTA_API_BASE_URL || "https://api.test.yottalabs.ai").replace(/\/$/, ""),
apiBaseUrl: (process.env.YOTTA_API_BASE_URL || "https://api.yottalabs.ai").replace(/\/$/, ""),
apiKey,
};
return _config;
Expand Down