Stormy Daniels is suing President Trump over a "hush" pact she says they drew up days before he was elected -- but he refused to sign.

In the lawsuit, Stormy claims Trump did her dirty by not signing the agreement, which intended to keep her from talking about their alleged 2006 affair, and hurting his presidential campaign. The ex-porn star says she signed on the dotted line, as did Trump's attorney, Michael Cohen.

She says they used aliases -- Trump was David Dennison and she was Peggy Peterson -- in the contract to maintain confidentiality, but he still never signed it.

According to docs, obtained by TMZ, Cohen contacted the ex-porn star shortly after the Access Hollywood tape came out. Stormy says Trump and Cohen caught wind she might go public, and "aggressively sought to silence" her with the "hush agreement."

As for her signing bonus, the now infamous $130k -- Stormy says it was routed through an entity called Essential Consultants LLC. She says the company was created right before the election purely to hide the source of the payment. Cohen has claimed he used his own personal funds to pay her.

She's suing to get a judge to rule the agreement is invalid ... which, presumably, would clear the path for her to tell all about her alleged relationship with Trump.