Vonage / vonage-node-sdk

Vonage API client for Node.js. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Apache License 2.0
374 stars 178 forks source link

users.create missing after upgrade #240

Closed sarkistlt closed 5 years ago

sarkistlt commented 5 years ago

I was on a version 2.1.0-beta-1, so to generate JWT I was doing the following:

const userAcl = {
      'paths': {
        '/v1/users/**': {},
        '/v1/conversations/**': {},
        '/v1/sessions/**': {},
        '/v1/knocking/**': {}
      }
    };

    return new Promise((resolve) => {
      nexmo.users.create({
        name: userName,
        display_name: userName,
      }, () => {
        const jwt = Nexmo.generateJwt(privateKey, {
          application_id: '****',
          sub: userName,
          exp: new Date().getTime() + 86400,
          acl: userAcl,
        });

        resolve(jwt);
      });
    });

after upgrading to 2.4.0, I'm getting error that nexmo.users is undefined, so how should I generate JWT after upgrade?

AlexLakatos commented 5 years ago

nexmo.users is only on beta releases, as well as conversations. You'll need to update to the latest @beta, which is v2.4.3-beta-1 To do that you can npm install nexmo@beta

sarkistlt commented 5 years ago

thanks for clarifying!