Comments (5)
Technically it doesn't have to be a singleton. I will plan on changing this in a future release. In the mean time below is the workaround for you to try.
var nexmo = require('EASYNEXMO');
var enexmo = require('easynexmo');
var dnexmo = require('EASYnexmo');
nexmo.initialize("key1","secret1",true);
enexmo.initialize("key2","secret2",true);
dnexmo.initialize("key3","secret3",true);
I dont personally like this but something to get you going while I get this change done.
from vonage-node-sdk.
@pvela any help required?
from vonage-node-sdk.
@pvela @wertlex - I've experimented in a branch that does a few things:
- Moves to ES2015 and uses Babel transpilation
- Moves towards a non-singleton API, but still uses the singleton within the
Nexmo
instance for now - Makes a start towards having functions live on related namespaces as per
Must be namespaced by concept
in the WiP (work in progress) library spec https://github.com/Nexmo/client-library-specification/blob/master/SPECIFICATION.md#api-methods
Any thoughts on this? e.g.
- Are we okay moving to ES2015?
- Do we think taking an incremental approach to non singltons is a good approach? Will it avoid a big bang and thus big changes?
Edit: Here's the branch https://github.com/Nexmo/nexmo-node/tree/namespaces
from vonage-node-sdk.
I am ok to move to ES2015. Thats the future 👍 .
I started doing a big bang approach in the old repo, but didn't make much progress. Having thought about it and made some initial design I can say for sure that its a good idea to take an incremental approach.
from vonage-node-sdk.
We are moving away from the singleton approach. Closing this question as answered.
from vonage-node-sdk.
Related Issues (20)
- Latest beta release uses deprecated "request" package, which has an open CVE HOT 3
- How can I create new User with this SDK??? HOT 1
- 401 Error when sending Whats App message HOT 5
- error Couldn't find package "@vonage/verify2@^1.3.0" required by "@vonage/server-sdk@^3.0.12" on the "npm" registry. HOT 3
- Typescript SyntaxError: Unexpected token '.' during compilation HOT 1
- WebsocketEndpointObject incorrect type
- Request timeout option is broken HOT 1
- Importing @vonage/server-sdk causes TypeScript errors because of incorrect imports in @vonage/voice HOT 14
- Error while trying to import library HOT 3
- [question] How to authenticate to the video package? HOT 2
- Request timeout option is still broken HOT 1
- Cannot send Whatsapp auth template message HOT 4
- readme example does not compile in TS HOT 2
- Messages CLI not working HOT 3
- Vonage.sms.verifySignature doesn't work with inbound SMS message HOT 3
- [Bug]: Issue with npm install HOT 1
- [Bug]: Error: secretOrPrivateKey must be an asymmetric key when using RS256 HOT 8
- [Bug]: typescript results in vetch missing @types/node-fetch HOT 1
- How Do I: send this whatsapp template HOT 3
- [Bug]: getOwnedNumbers seems to return string (JSON) and not an object HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vonage-node-sdk.