The force:hasRecordId interface does two things to a component that implements it.
- It adds an attribute named recordId to your component.
- When your component is invoked in a record context in Lightning Experience or the Salesforce app, the recordId is set to the ID of the record being viewed.