Was Rahab saved by her good works?

By faith we are saved, not by good works. It’s the cry of the Reformation, and it makes a lot of sense. If we are able to save ourselves through works, Jesus died in vain. But in the book of James, it sounds like Rahab’s deed saved her. Let’s look a little closer.