Coder Social home page Coder Social logo

Comments (6)

cbetta avatar cbetta commented on May 28, 2024 1

@leggetter check, I just figured that out. I was going to suggest similar behaviour for the node library indeed.

from vonage-node-sdk.

tjlytle avatar tjlytle commented on May 28, 2024

@cbetta I missed specifying this in the client spec (will add) but we ran into a similar conversation around the python library. I'll be updating the spec to read that the client libraries must accept the key as a string, and may provide a way to pass a filename. Reasoning is the former is possible regardless of how you store the key, the latter dictates storage that may be difficult or impossible depending on how you deploy your application.

from vonage-node-sdk.

leggetter avatar leggetter commented on May 28, 2024

Node supports Buffer or a string path at present.

from vonage-node-sdk.

cbetta avatar cbetta commented on May 28, 2024

@leggetter yet it does not support this:

var Nexmo = require('nexmo');

var nexmo = new Nexmo({
    apiKey: 'key',
    apiSecret: 'secret',
});


nexmo.app.create(
  'First Voice App',
  'voice',
  'http://example.com/answer',
  'http://example.com/event',
  {},
  function(err, res) {
    var appId = res.id;
    var privateKey = res.keys.private_key;

    nexmo = new Nexmo({
      apiKey: 'key',
      apiSecret: 'secret',
      applicationId: appId,
      privateKey: privateKey
    });
  }
);

What am I missing?

from vonage-node-sdk.

leggetter avatar leggetter commented on May 28, 2024

It doesn't support the key being passed as a string. Just:

  1. String - path to file
  2. Buffer - contents of key loaded into a buffer

The suggestion elsewhere has been to check the start of the string to see if it's the key. See https://github.com/Nexmo/nexmo-python/issues/12

from vonage-node-sdk.

leggetter avatar leggetter commented on May 28, 2024

Closed via #80

from vonage-node-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.