There are different ways people choose to organize their assets, whether the stylesheets, javascript or images. If this was going to be a production app that I could reasonably expect would grow in complexity and in usage, I would probably do it differently. However, as the use case here was something fun for kids (or any other group of friends, etc.) I was less concerned with adopting a specific opinion on Webpack asset folder structure. As an aside, if this was to be anything more than what it was intended for, I also would not recommend implementing the "security" protocols the way I did either, as that is not very secure! A real production app would want to have more than hiding the moderator functions with a CSS element style! :)
I am clearly failing to communicate what I'm trying to ask. Let me try harder/better.
I'm a Rails developer, not a Node developer - so you can safely presume that I'm not looking for a Node library in any potential future inquiry. ;)
What I am trying to do is load whatever client library is necessary via my webpack application.js pack file, specifically so that I don't have to resort to putting a script tag in my HEAD and addressing the TokBox classes via the global namespace.
I think what I'm looking for is an ES6 module, probably downloaded and added to my package.json via npm add?
FWIW, the answer could very well be "no, we haven't done that (yet)"!
If I understand correctly, then the answer is you can add the OpenTok JS/Node SDK to your application via Webpack with yarn add opentok or npm install opentok without the use of a script tag.
Hello again,
Thanks so much!
There are different ways people choose to organize their assets, whether the stylesheets, javascript or images. If this was going to be a production app that I could reasonably expect would grow in complexity and in usage, I would probably do it differently. However, as the use case here was something fun for kids (or any other group of friends, etc.) I was less concerned with adopting a specific opinion on Webpack asset folder structure. As an aside, if this was to be anything more than what it was intended for, I also would not recommend implementing the "security" protocols the way I did either, as that is not very secure! A real production app would want to have more than hiding the moderator functions with a CSS element style! :)
There is indeed a Node SDK for OpenTok. Reference docs are here: tokbox.com/developer/sdks/node/.
So, yeah... now that I've clarified I meant "is there a way to import the OpenTok library without needing a script tag in the document"... is there? Not a rhetorical question. Hoping to put this API to work!
Yes, there is, look at the last sentence in my last reply :)
I am clearly failing to communicate what I'm trying to ask. Let me try harder/better.
I'm a Rails developer, not a Node developer - so you can safely presume that I'm not looking for a Node library in any potential future inquiry. ;)
What I am trying to do is load whatever client library is necessary via my webpack application.js pack file, specifically so that I don't have to resort to putting a script tag in my HEAD and addressing the TokBox classes via the global namespace.
I think what I'm looking for is an ES6 module, probably downloaded and added to my package.json via
npm add
?FWIW, the answer could very well be "no, we haven't done that (yet)"!
Not a problem, I think I understand now.
If I understand correctly, then the answer is you can add the OpenTok JS/Node SDK to your application via Webpack with
yarn add opentok
ornpm install opentok
without the use of a script tag.Thanks for trying, Ben. That package is, once again, the node server implementation. I'm looking for the client. :)
It's all good... I think that the @opentok/client is the module I'm looking for. I'll let you know how I make out!
Glad you followed the link! Best of luck to you!
I actually meant on the client: github.com/nexmo-community/rails-v...
I'm a Rails dev. :)