is used for an action which happened before another past action or a specific time in the past
The past perfect expresses the idea that something occurred before another action in the past. I had never seen such a beautiful beach before I went to Kauai.
If the past perfect is not referring to an action at a specific time, past perfect is not optional.She had never seen a bear before she moved to Alaska.