agence104 / livekit-server-sdk-php

PHP Server SDK to LiveKit
Apache License 2.0
41 stars 16 forks source link

Please include PHP dotenv #3

Closed prattcmp closed 1 year ago

prattcmp commented 1 year ago

Please include the PHP dotenv library. It loads environment variables stored in .env so that they are available to getenv() for the API Key and API Secret.

Here is the library: https://github.com/vlucas/phpdotenv

p-delorme commented 1 year ago

Hello @prattcmp,

The script already fetches for getenv() if no apikey or apiSecret is provided. See: https://github.com/agence104/livekit-server-sdk-php/blob/master/src/AccessToken.php#L58

I feel like these variables shouldn't be handled through the code but rather from a server configuration.

With this said, if you are planning on using a .env file, couldn't you simply add this library to your project and use it when you'll be implementing the SDK in your project?

prattcmp commented 1 year ago

@p-delorme,

The script already fetches for getenv() if no apikey or apiSecret is provided. See: https://github.com/agence104/livekit-server-sdk-php/blob/master/src/AccessToken.php#L58

Yes, I know. It's a great feature :).

With this said, if you are planning on using a .env file, couldn't you simply add this library to your project and use it when you'll be implementing the SDK in your project?

Yes, that's what I am doing right now, but it would be nice to be automatically included by this library.

p-delorme commented 1 year ago

Hello @prattcmp,

Thank you for providing your feedback. With this said, I would rather want to keep the dependencies as slim as possible for the SDK itself and leave it to the developer if they would like to implement this library into their codebase or not.

For the time being, this will not be implemented unless we do get more requests for it, then I can think about it some more.

I hope you understand and I wish you a wonderful day :)