# NextJS | Web Meeting SDK | Component View - ReferenceError: window is not defined

**URL:** <https://devforum.zoom.us/t/nextjs-web-meeting-sdk-component-view-referenceerror-window-is-not-defined/64248>\
**Category:** Web\
**Created:** [February 13, 2022, 3:02pm UTC](https://devforum.zoom.us/t/nextjs-web-meeting-sdk-component-view-referenceerror-window-is-not-defined/64248 "2022-02-13T15:02:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![pranshu.midha](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pranshu.midha/32/34432_2.png) [@pranshu.midha](https://devforum.zoom.us/u/pranshu.midha)\
**Post date:** [February 16, 2022, 3:13am UTC](https://devforum.zoom.us/t/nextjs-web-meeting-sdk-component-view-referenceerror-window-is-not-defined/64248/3 "2022-02-16T03:13:16Z")

</div>

I found a solution for this. I had to load the scripts via CDN rather than import via npm.

```auto
import React, {useState, useEffect, useRef} from "react";
import Script from 'next/script'

const Page = () => {
const zoomRef = useRef(null);

useEffect(() => { // Or componentDidMount

        const client = ZoomMtgEmbedded.createClient()

        client.init({
            debug: true,
            zoomAppRoot: zoomRef.current,
            language: 'en-US',
            customize: {
              meetingInfo: [
                'topic',
                'host',
                'mn',
                'pwd',
                'telPwd',
                'invite',
                'participant',
                'dc',
                'enctype',
              ],
              toolbar: {
                buttons: [
                  {
                    text: 'Custom Button',
                    className: 'CustomButton',
                    onClick: () => {
                      console.log('custom button');
                    },
                  },
                ],
              },
            },
          });

          client.join({
            apiKey: yourKey,
            signature: yourSignature,
            meetingNumber: yourMeet,
            password: yourPass,
            userName: yourName
        })
    }, [])

return(
        <>
           <link
          type="text/css"
          rel="stylesheet"
          href="https://source.zoom.us/2.2.0/css/bootstrap.css"
        /> 
        <link
          type="text/css"
          rel="stylesheet"
          href="https://source.zoom.us/2.2.0/css/react-select.css"
        />

        <Script src="https://source.zoom.us/2.2.0/lib/vendor/react.min.js" strategy="beforeInteractive" /> 
      <Script src="https://source.zoom.us/2.2.0/lib/vendor/react-dom.min.js" strategy="beforeInteractive" />
      <Script src="https://source.zoom.us/2.2.0/lib/vendor/redux.min.js" strategy="beforeInteractive" />
      <Script src="https://source.zoom.us/2.2.0/lib/vendor/redux-thunk.min.js" strategy="beforeInteractive" />
      <Script src="https://source.zoom.us/2.2.0/lib/vendor/lodash.min.js" strategy="beforeInteractive" />
       <Script src="https://source.zoom.us/2.2.0/zoom-meeting-embedded-2.2.0.min.js" strategy="beforeInteractive" />

<div id="”meetingSDKElement”" ref={zoomRef}>

</>
}

export default Page;

```

---

_[View the full topic](https://devforum.zoom.us/t/nextjs-web-meeting-sdk-component-view-referenceerror-window-is-not-defined/64248)._
