The following applies to Alfred 4+. For Alfred 3, see below.
The equivalents to the above in JXA JavaScript (again, the exportable variable is optional):
Application('com.runningwithcrayons.Alfred').setConfiguration('browser', {
toValue: 'Safari',
inWorkflow: 'net.deanishe.demo',
exportable: true