SVG containing the background color seems to be working for me. What Sketch version are you using?
Are you ticking the
Include in Export setting?
You'll have to dip into the Objective-C API to get the background color
Assuming an artboard is selected:
var api = require('sketch')
var document = api.getSelectedDocument()
var selection = document.selectedLayers
var objCArtboard = selection.layers.sketchObject;