# webSDK - React is not defined and s.AK.connectSocket is not a function

**URL:** <https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647>\
**Category:** Web\
**Created:** [February 12, 2024, 8:36am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647 "2024-02-12T08:36:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaichka175](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chaichka175/32/47240_2.png) [@chaichka175](https://devforum.zoom.us/u/chaichka175)\
**Post date:** [February 12, 2024, 8:36am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/1 "2024-02-12T08:36:20Z")

</div>

@zoomus/websdk - 2.18.3  
react - 16.13.1  
error - [screenshot](https://prnt.sc/Pqgh5XyBjLco)  
when i use [https://source.zoom.us/2.18.3/lib](https://source.zoom.us/2.18.3/lib) - i get 403(forbidden)  
The error happened suddenly. Everything worked and no configuration was changed. After that, I updated the webSDK version and started having problems with React

```auto
const { ZoomMtg } = await import('@zoomus/websdk');

			ZoomMtg.setZoomJSLib('https://source.zoom.us/2.17.0/lib', '/av');
			ZoomMtg.preLoadWasm();
			ZoomMtg.prepareWebSDK();
			ZoomMtg.generateSDKSignature({
				meetingNumber,
				role: role.toString(),
				sdkKey: ZOOM.VIDEOSDK.KEY,
				sdkSecret: ZOOM.VIDEOSDK.SECRET,
				success: (signature: any) => {
					ZoomMtg.init({
						leaveUrl: backUrl || window.location.origin,
						disablePreview: true,
						success: () => {
							document.title = 'mRecords meeting';
							ZoomMtg.join({
								meetingNumber,
								sdkKey: ZOOM.VIDEOSDK.KEY,
								signature: signature.result,
								userName: userName ?? '',
								passWord: password.toString() ?? '',
								tk: '',
								success: () => {
									document.addEventListener('visibilitychange', () => {
										if (document.visibilityState === 'hidden') {
											ZoomMtg.leaveMeeting({
												confirm: false,
												success: () => {
													console.log('success leave');
												},
												error: (error: any) => {
													console.log(error);
												},
											});
										}
									});
									document.title = 'mRecords meeting';
									console.log('<--- Joined --->');
								},
								error: (error: any) => {
									console.log(error);
								},
							});
						},
						error: (error: any) => {
							console.log(error);
						},
					});
				},
				error: (error: any) => {
					console.log(error);
				},
			});
		} catch (error) {
			console.error('Error fetching data:', error);
		}

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 13, 2024, 5:15am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/2 "2024-02-13T05:15:18Z")

</div>

@chaichka175 ,

Could you try with a valid version such as 2.18.2?

---

<div class="post-metadata">

**Author:** ![chaichka175](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chaichka175/32/47240_2.png) [@chaichka175](https://devforum.zoom.us/u/chaichka175)\
**Post date:** [February 13, 2024, 7:11am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/3 "2024-02-13T07:11:20Z")

</div>

Hello @chunsiong.zoom  
I am getting the same problem

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 13, 2024, 7:59am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/4 "2024-02-13T07:59:09Z")

</div>

what problem are you getting @chaichka175

---

<div class="post-metadata">

**Author:** ![chaichka175](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chaichka175/32/47240_2.png) [@chaichka175](https://devforum.zoom.us/u/chaichka175)\
**Post date:** [February 13, 2024, 8:02am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/5 "2024-02-13T08:02:59Z")

</div>

@chunsiong.zoom  
I have this error - [Screenshot by Lightshot](https://prnt.sc/Pqgh5XyBjLco)

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 13, 2024, 8:06am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/6 "2024-02-13T08:06:54Z")

</div>

ok @chaichka175,

on your html page, are you loading these?  
ignore the version number as I’m using 2.18.0 instead of 2.18.2  
You will need to load these javascript files before loading the zoom js library

```auto
    <!-- For Component and Client View -->
    <script src="https://source.zoom.us/2.18.0/lib/vendor/react.min.js"></script>
    <script src="https://source.zoom.us/2.18.0/lib/vendor/react-dom.min.js"></script>
    <script src="https://source.zoom.us/2.18.0/lib/vendor/redux.min.js"></script>
    <script src="https://source.zoom.us/2.18.0/lib/vendor/redux-thunk.min.js"></script>
    <script src="https://source.zoom.us/2.18.0/lib/vendor/lodash.min.js"></script>

    <!-- For Client View -->
    <script src="https://source.zoom.us/zoom-meeting-2.18.0.min.js"></script>
    <script type="text/javascript" src="/client-view.js"></script>

```

---

<div class="post-metadata">

**Author:** ![chaichka175](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chaichka175/32/47240_2.png) [@chaichka175](https://devforum.zoom.us/u/chaichka175)\
**Post date:** [February 13, 2024, 9:02am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/8 "2024-02-13T09:02:16Z")

</div>

@chunsiong.zoom Thank you so much. I think it is solution

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [February 14, 2024, 2:55am UTC](https://devforum.zoom.us/t/websdk-react-is-not-defined-and-s-ak-connectsocket-is-not-a-function/103647/9 "2024-02-14T02:55:06Z")

</div>


