add MAGIC_KEY env var to configure magic key
add MAGIC_KEY env var to configure magic key