Closed WahidinAji closed 1 month ago
hmm it looks like it already exists after I read this code https://github.com/rudderlabs/rudder-php-sdk/blob/master/lib/Rudder.php#L22
but still need a write key?
Hello @WahidinAji, Thank you for your feedback!
The write key is the SDK's primary input required for sending events to the server. Without it, there is no point in proceeding further, as it's a mandatory configuration.
While the data plane URL is optional (we provide a default value assuming users are on the free tier), the write key is always required. We enforce this in the init method here, where an exception is thrown if the write key is not supplied.
When the tracking APIs are invoked in this case, an exception is triggered to prevent further execution.
I believe, regardless of the SDK's mode, the process should not move forward without this essential input.
We truly value your suggestion and will evaluate it carefully for potential improvements.
I know it's a little weird, but imagine if a Company has 5 developers. 2 of them developed a feature to add this RudderStack, they had the write_key but 3 of them had no write_key. if 3 of them wanna run the project, it's getting an error because no write_key in init() because they don't have the key. The request is simply, if the write_key is null or empty the RudderStack should not record or run anything. Just send a warning to the developer that they should put write_key. obsoletely add also in init is it development mode production mode.
if it's in development mode, then send the warning only. if it's production mode, then send error.