Using the `@zoom/appssdk` npm package

Hi all,

I feel like I might be missing something obvious here, but I’ve gone ahead and installed the new @zoom/appssdk npm package;

npm i @zoom/appssdk --save

but our application gives an error;

 Can't find variable: zoomSdk

I’ve added the following line where ever the sdk is used;

/* globals zoomSdk */

But our JavaScript app still doesn’t recognize the zoomSdk object. Is there something else I need to do? I looked at the advanced react app example, and in this case they use the CDN, however I had the same issue when I included it like that - sdk not found. Any ideas?

Thanks!

Looks like using;

import zoomSdk from '@zoom/appssdk';

resolved it :eyes:

3 Likes

Another question:

We are using TypeScript, and previously I created types for the sdk, events, apis etc.

Is there a way to import the TypeScript types from the npm package and use them in our application?

Thanks!

Great question, @om7! Happy to look into this and circle back with my findings. First, would you be able to share what you’ve already tried and the results of your testing?

Hey @donte.zoom , I’m wondering:

  1. is it possible to import the types declared in the Zoom Apps SDK for use in our TypeScript project?
  2. if not, would Zoom consider exporting those types?

In our project, they are all found under: node_modules/@zoom/appssdk/dist/sdk.d.ts

Perhaps this is a question Daniel Fried can help with? I can’t seem to find his forum handle

Thanks!

Oliver

1 Like

@om7,
The recommendation is to extract the file found under:node_modules/@zoom/appssdk/dist/sdk.d.ts straight from your NPM library (perhaps using jsconfig.json, globals.d.ts). While the types are publicly available, you should know they are subject to change over time as updates to the SDK are released.

1 Like

Ok, great. Thanks @donte.zoom .

And yes, it is expected that they would change with new versions of the SDK :smile: we want to ensure we’re using the APIs as intended and with the correct types each release!

@om7 ,

You’re welcome! I’ve reached out to internal resources and it looks like there will be documentation on importing types forthcoming. However, no timeline is set at the moment.

1 Like