Modafinil, sold under the brand name Provigil among others, is a medication to treat sleepiness due to narcolepsy ,shift work ,sleep disorder , or obstructive sleep apnea  While it has seen off- label use  as a purported cognitive enhancer , the research on its effectiveness for this use is not conclusive. It is taken by mouth.
Common side effects include headache, anxiety, trouble sleeping, and nausea. Serious side effects may include allergic reactions such as anaphylaxis , Steven – Johnsons Syndrome , and hallucinations . It is unclear if use during pregnancy is safe.
The amount of medication used may need to be adjusted in those with kidney or liver problems. It is not recommended in those with an arrythmia , significant hypertension , or left ventricular hypertrophy.
Medical
Modafinil is a eugeroic used for treatment of narcolepsy ,shift work,sleep disorder and excessive daytime sleepiness  associated with obstructive sleep apnea.
For obstructive sleep apnea, it is recommended that continuous positive airway pressure be appropriately used before considering starting modafinil to help with daytime sleepiness
Adverse effects and contraindications
Modafinil is contraindicated in people with known hypersensitivity to modafinil, armodafinil , or inactive ingredients. Modafinil is not approved for use in children for any medical conditions.
The incidence of adverse effects is reported as the following: less than 10% of users report having a headache, nausea, and decreased appetite. Between 5% to 10% of users may be affected with anxiety, insomnia, dizziness, diarrhea, and rhinitis.
Rare occurrences have been reported of more serious adverse effects, including severe skin rashes and other symptoms that are probably allergy related.
The long-term safety and effectiveness of modafinil have not been determined.
Modafinil may have an adverse effect on hormonal contraceptives for up to a month after discontinuation.
Addiction and dependence
The addiction and dependence liabilities of modafinil are relatively low. It shares biochemical mechanisms with addictive stimulant drugs, and some studies have reported it to have similar mood-elevating properties, although to a lesser degree.
Tolerance
Large-scale clinical studies have found no evidence of tolerance with modafinil at therapeutic dosages even with prolonged use (for 40 weeks and as long as three years).