From what I know it isnt possible to have the rows automatically fit to data, this can only be done for columns with autoResizeColumn().
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
sheet.getRange('a1').setValue('Whenever it is a damp, drizzly November in my soul...');
// Sets the first column to a width which fits the text
sheet.autoResizeColumn(1);
However, if you know how much space your data will take you can just use a setRowHeight(). I think this is the only option you have for rows, columns seemed to be the prefered part to auto-fit.
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
// Sets the first row to a height of 200 pixels
sheet.setRowHeight(1, 200);
Hope this helps!