Optionally has 2 different meanings across 1 category:
Adverb
Adverb
1
in an optional manner
"this rule is applied optionally"
2
In an optional manner. Not mandatorily.
"You can optionally join us for dinner, but it's not required if you have other plans."