One way of doing this is to build using the command line tool and change your project dependencies depending on which platform/portal you are building for.
You can have project setting “stub” files, like this:
poki.settings
[project]
dependencies#0 = https://github.com/defold/https://github.com/defold/extension-poki-sdk/archive/refs/tags/1.4.3.zip
# build for poki
java -jar bob.jar --settings=poki.properties --platform=js-web --archive build bundle
# build for another platform
java -jar bob.jar --settings=another_platform.properties --platform=js-web --archive build bundle
# and so on ...
This will then replace the fields you have in your main game.project file with the fields from the “stub” file you are using. And then in your code you have a wrapper or check which SDK is present and call the appropriate functions.
if poki_sdk then
poki_sdk.gameplay_start()
elseif my_other_sdk then
my_other_sdk.start()
end