After a heated South Korean election campaign that presaged tensions with the United States, the country’s new leader is trying to get off on the right foot with President Trump. The early courtship seems to be going well, but some fundamental challenges loom for the two rookie presidents.

President Moon Jae-in, a progressive who campaigned on engaging North Korea, is in many ways the opposite of Trump, who rose to power on a nationalist wave, promising to force allies off the U.S. dole. But in the early stages of the new bilateral relationship, both administrations have shown a pragmatist streak and are projecting unity and agreement.

That message was on full display this week when Moon’s personal envoy visited Washington and met with Trump in the Oval Office. Hong Seok-hyun, a former chairman of JoongAng Media Network who also served as an ambassador to Washington, told The Post on Friday that the U.S. and South Korean governments are in lockstep on the key issues facing the alliance, especially how to deal with North Korea.

“At the moment, we are in full agreement,” Hong said in a meeting with the editorial board.

Hong had only 15 minutes in the Oval Office with Trump, but the two covered a lot of ground. Vice President Pence and national security adviser H.R. McMaster were on hand, and senior adviser Jared Kushner stopped by for a handshake. Hong handed over a personal letter from Moon to Trump.

Overall, Hong followed the proven winning formula for any visiting dignitary: praising Trump’s early actions and agreeing with Trump’s views.

“I commended his leadership in driving international cooperation in resolving the North Korean crisis, in particular getting China committed to the sanctions programs, which was unprecedented,” Hong said.

Trump in turn expressed optimism and confidence in the future of the U.S.-South Korean alliance, according to Hong. Both sides agreed that the international community should work together to raise the pressure on Pyongyang for now, turning to engagement only if and when the regime of Kim Jong Un shows change through actions, he said.

Hong told reporters just after the meeting that Trump told him the United States is willing to engage with North Korea if the conditions become right, after which the South Korean foreign ministry praised the “joint stance” of the two countries.

But the reason Hong’s meeting with Trump went so well could be that issues the two sides don’t agree on were never broached. Neither Trump nor Hong raised the issue of the THAAD missile defense system. Trump angered the Korean public just days before Korea’s election by demanding that Seoul pay the $1 billion price tag for the system.

McMaster later reassured the South Korean government that the United States would adhere to its agreement to pay, but Trump then reportedly scolded McMaster for contradicting him.

Hong said the issue of THAAD did come up in his follow-up meeting Wednesday with McMaster — but not who would pay. Hong told McMaster that the South Korean National Assembly would have to review how the deal over THAAD was struck, but he said he would bet money the assembly ultimately approves it.

“The whole process was not democratic,” said Hong. “So I think President Moon, when he was campaigning, made a pledge that it should be revisited. … It’s not a matter between the U.S. and Korean government, it’s more an internal domestic necessity.”

In neither meeting did the topic of the U.S.-Korea Free Trade Agreement (KORUS) come up, despite that last month Trump called it “a horrible deal” and threatened to terminate it. The White House officials didn’t bring it up, so the Korean side saw no need to raise it.

It seems as though Seoul is depending on Congress to protect that agreement. Hong also met with congressional leaders this week and said, “They unanimously feel there’s no problem with KORUS.”

Hong did raise with Trump the fact that there has been no official U.S. ambassador to South Korea for almost four months and no sign a nomination is coming anytime soon.

Part of why Moon may be more committed to the U.S. alliance these days is because China’s harsh campaign against the South Korean economy over the THAAD issue has caused a fierce backlash among the South Korean public.

“People realized that China is a nation that’s not worthy of its size. People for the first time realized that China could be a menace to us,” said Hong. “The man on the street now feels that if we rely to China we will be in trouble. It’s a good lesson that we learned from this.”

Despite all the happy talk this week, there is still evidence that Washington and Seoul don’t completely see eye to eye. For example, Hong warned that the Trump administration must not place too much faith in China to solve the North Korean problem.

“The U.S. shouldn’t overestimate the influence that Chinese can exercise, even economic leverage,” he said.

Overall, both sides are doing what they should, finding common areas of interest and establishing relationships of trust. But sooner rather than later, Trump and Moon are going to have to seriously address the issues both sides know will be contentious, for the long-term good of the alliance.