# Your feedback requested: Node.js SDK 5.0.0 alpha

**URL:** <https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774>\
**Category:** Feedback\
**Tags:** typescript, javascript\
**Created:** [December 20, 2024, 9:38pm UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774 "2024-12-20T21:38:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwhinnery](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/kwhinnery/32/764948_2.png) [@kwhinnery](https://community.openai.com/u/kwhinnery)\
**Post date:** [December 20, 2024, 9:38pm UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/1 "2024-12-20T21:38:16Z")

</div>

Hey everyone!

We’re pleased to share that a new alpha of the 5.0.0 version of the JavaScript / TypeScript SDK is [available on npm](https://www.npmjs.com/package/openai/v/5.0.0-alpha.0) and in the [`alpha` branch of the GitHub repository](https://github.com/openai/openai-node/tree/alpha). This version of the SDK represents a breaking change to the existing 4.x SDK, as we have migrated completely to using built-in `fetch` for HTTP requests across all environments (Node.js, Deno, etc). However, we do expect that most of your code will “just work” with minor adjustments in types.

We would love your help and feedback on this new version - if you have any thoughts you’d like to share, please comment on this post.

Thanks in advance, and have a great holiday!

---

<div class="post-metadata">

**Author:** ![anon37218972](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@anon37218972](https://community.openai.com/u/anon37218972)\
**Post date:** [December 21, 2024, 12:21am UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/3 "2024-12-21T00:21:56Z")

</div>

I really like it! I found it to be really cool to explore the changes at [Comparing master...alpha · openai/openai-node · GitHub](https://github.com/openai/openai-node/compare/master...alpha)

after upgrading to 5.0.0 everything works perfectly!

---

<div class="post-metadata">

**Author:** ![s1l](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/s1l/32/527686_2.png) [@s1l](https://community.openai.com/u/s1l)\
**Post date:** [December 29, 2024, 6:39pm UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/4 "2024-12-29T18:39:27Z")

</div>

Thank god for this. no one should use axios or node-fetch in 2024. I will switch to it today and report any issues on github.

---

<div class="post-metadata">

**Author:** ![sudarsangp](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sudarsangp](https://community.openai.com/u/sudarsangp)\
**Post date:** [January 5, 2025, 3:23pm UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/5 "2025-01-05T15:23:29Z")

</div>

Hi Team,

I am using `5.0.0-alpha.0`  
I don’t get this error in node version `v18.17.0` but I get this error with node version `v16.20.2`.

> `fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`

Is this related to node version?

---

<div class="post-metadata">

**Author:** ![probablyrobert](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/probablyrobert/32/146250_2.png) [@probablyrobert](https://community.openai.com/u/probablyrobert)\
**Post date:** [January 5, 2025, 6:46pm UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/6 "2025-01-05T18:46:46Z")

</div>

Hey @sudarsangp, yes this is related to your node version. We’re dropping all support for v16 as active support was dropped over 2 years [ago](https://endoflife.date/nodejs). Our [minimum](https://github.com/openai/openai-node#requirements) supported version is v18.

You’ll have to use a polyfill if you want to continue using v16.

---

<div class="post-metadata">

**Author:** ![toyamarinyon](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/toyamarinyon/32/528335_2.png) [@toyamarinyon](https://community.openai.com/u/toyamarinyon)\
**Post date:** [January 21, 2025, 8:25am UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/7 "2025-01-21T08:25:39Z")

</div>

I use it with Next.js. it’s so good cause prevent punycode warning!!

If you use beta feature such as vector stores, assitants, you should add header ’ ‘OpenAI-Beta: assistants=v2’'.

```ts
await openai.beta.vectorStores.files.createAndPoll(
		input.openAiVectorStoreId,
		{
			file_id: file.id,
		},
		{
			headers: {
				"OpenAI-Beta": "assistants=v2",
			},
		},
	);

```

---

<div class="post-metadata">

**Author:** ![probablyrobert](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/probablyrobert/32/146250_2.png) [@probablyrobert](https://community.openai.com/u/probablyrobert)\
**Post date:** [January 21, 2025, 10:07am UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/8 "2025-01-21T10:07:18Z")

</div>

Ah thanks for the report, you shouldn’t have to specify the `OpenAI-Beta` header explicitly, that’s a bug. Will investigate!

---

<div class="post-metadata">

**Author:** ![zhiyouwo](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/zhiyouwo/32/511272_2.png) [@zhiyouwo](https://community.openai.com/u/zhiyouwo)\
**Post date:** [March 21, 2025, 5:46am UTC](https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/9 "2025-03-21T05:46:58Z")

</div>

Does it support ai agent? ??
