I am getting an error while importing Google AI API SDK [duplicate]

I am working on a chrome extension where I need to call the Google AI API. When I try importing the SDK in my content.js using

import { GoogleGenerativeAI } from "@google/generative-ai";

I get an error

Uncaught SyntaxError: cannot use import outside a module

The question is how can I import the SDK in my extension which is completely client side. Is there any other way to deliver the SDK alongwith the extension?