Closed prattcmp closed 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?
@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.
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 :)
Please include the PHP dotenv library. It loads environment variables stored in
.env
so that they are available togetenv()
for the API Key and API Secret.Here is the library: https://github.com/vlucas/phpdotenv