Skip to content

Commit a51ae06

Browse files
authored
api_key & secret not mandatory
changes to the api_key and api_secret params to allow users to create a client object without these parameters, for example when using the new VAPI api and authenticating with JWT key & secret are not required you just use the application_id and private key.
1 parent 1a43002 commit a51ae06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nexmo/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class AuthenticationError(ClientError):
2424

2525
class Client():
2626
def __init__(self, **kwargs):
27-
self.api_key = kwargs.get('key', None) or os.environ['NEXMO_API_KEY']
27+
self.api_key = kwargs.get('key', None) or os.environ.get('NEXMO_API_KEY', None)
2828

29-
self.api_secret = kwargs.get('secret', None) or os.environ['NEXMO_API_SECRET']
29+
self.api_secret = kwargs.get('secret', None) or os.environ.get('NEXMO_API_SECRET', None)
3030

3131
self.signature_secret = kwargs.get('signature_secret', None) or os.environ.get('NEXMO_SIGNATURE_SECRET', None)
3232

0 commit comments

Comments
 (0)