Joshua 2:11 "And as soon as we had heard [these things], our hearts did melt, neither did there remain any more courage in any man, because of you: for the LORD your God, he [is] God in heaven above, and in earth beneath."
“God in heaven above, and in earth beneath”: She confessed the realization that He is the sovereign Creator and Sustainer of all that exists, therefore the Supreme One.
The recognition of God for who He is will get a person saved. Rahab has fulfilled the Scripture in Romans:
Romans 10:10 "For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation."
Rahab does not know this God of Israel personally, but she believes in her heart that He is truly God. Rahab realizes the idols are not real. She expresses here, that the LORD, He is God of everyone.
This type of faith gets God's attention. The sinful life she is living cannot keep her from being redeemed. God will wash her and make her sins white as snow.
This is the type of faith that makes us Christians.