How to create a feathered border around an object? This is the best way I could possibly phrase this question.

What I want to do is mix two different materials.

I want to use the secondary material to catch the rimlight of the object, but I only want this effect to show up close to the border of an object.

Simply using the angles of the faces will result in too much spill of the secondary material over the primary material. This only works on a simple object, where the falloff angle of the polygons is even.

Is there a way to create a mask within the shader editor to basically create a blurred outline within the object border? I want to avoid using the compositor for this.
You might set transparancy based upon camera facing normals (ea not facing). (layer weight)
To get something that looks a little bit smoother.