In a previous house I had a wireless sensor that was cylindrical. I drilled a roughly 3/4" - 7/8" diameter hole in the doorframe and slide it in, so it wasn't at all visible when the door was closed. Because of the packaging and form factor, some exotic things, like that, are far easier to buy than build, though I suppose it would be within the grasp of someone with skills who was determined to make their own.
Less exotic: if you made your sensor flat enough, you could hollow out the door molding and hide it inside of that. A properly designed door sensor could run off of a CR2032 coincell battery for 10+ years, so it's not such a wild idea.