Finely dice the onion. Fry half of it with the ham in a little oil in a pan until everything starts to turn lightly brown, then let it cool down.
In the meantime, mix the cream cheese with the crème fraîche. Mix the cooled ham and onion mixture and the remaining raw onion with it. Season the cream with salt and pepper.