The United States Congress formally recognized the Pledge of Allegiance and added it to the Federal Flag Code.

The US Flag Code describes the appropriate ways to handle and carry the flag. It also has various sections which discuss other patriotic themes, such as the Pledge of Allegiance.

Source