Skip to content

Commit

Permalink
chore: update apiKeyHeader to apiKey (#20)
Browse files Browse the repository at this point in the history
* chore: update `apiKeyHeader` to `apiKey`

* fix compile

---------

Co-authored-by: dsinghvi <[email protected]>
  • Loading branch information
fern-support and dsinghvi authored Dec 5, 2024
1 parent 071cc14 commit 0f54d2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Instantiate and use the client with the following:
```typescript
import { CartesiaClient } from "@cartesia/cartesia-js";

const client = new CartesiaClient({ apiKeyHeader: "YOUR_API_KEY_HEADER" });
const client = new CartesiaClient({ apiKey: "YOUR_API_KEY_HEADER" });
await client.tts.bytes({
modelId: "sonic-english",
transcript: "Hello, world!",
Expand All @@ -47,7 +47,7 @@ await client.tts.bytes({
import { CartesiaClient } from "@cartesia/cartesia-js";

const cartesia = new CartesiaClient({
apiKeyHeader: "your-api-key",
apiKey: "your-api-key",
});

// Initialize the WebSocket. Make sure the output format you specify is supported.
Expand Down
2 changes: 1 addition & 1 deletion src/wrapper/Websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default class Websocket {
(await core.Supplier.get(this.options.environment)) ?? environments.CartesiaEnvironment.Production
).replace(/^https?:\/\//, "");
const params = {
api_key: this.options.apiKeyHeader,
api_key: this.options.apiKey,
cartesia_version: this.options.cartesiaVersion,
};
return `wss://${baseUrl}/tts/websocket${qs.stringify(params, { addQueryPrefix: true })}`;
Expand Down

0 comments on commit 0f54d2e

Please sign in to comment.