angular position sensor

Good evening,
can any one tell me how to use an angular position sensor / magnet position AS500106 and AN8/ how does it work
and how to connect it to Arduino

datasheet explains. CHERRY MX - Schalter für mechanische Tastaturen

Run sensor from 5V.
If 180 deg type:
Datasheet says 10% of 1023 = 102 (0 deg)
and 90% of 1023 = 920 (180 deg)

int num=analogRead(pin);
int angle = map(num,102,920,0,180);