How can I use Nakama with Cocos?

I imported the cocos client into my typescript test.ts
import { Client } from './nakama-js.umd.js'
and made a new client in the start function but when I play in cocos. It does not recognise the constructor.

I also tried turning it into a plugin from that other thread I found Nakama Js Client With Cocos Creator 3.0 - #2 by MrZak-dev