The Rules as Written are based on the official rule books: the Dungeon Masters Guide, the Monster Manual, and the Players Handbook. The Starter Set is, as you noted, an incomplete presentation of those core rules, as are the Basic Rules (and the SRD) that are freely available on-line. If there is a conflict between them, the core rules (MM, DMG, PHB) will generally take precedence1.
- A caveat to the above is well summarized in paragraph 3 of this
answer. D&D 5e has tried to move toward "rulings over rules"
since the developers are aware of how (regardless of the amount of
effort put into perfecting a rule set) the play of the game is the
most important aspect of an adventure or a campaign.
To get the most out of a RAW reference, the official errata as posted by WoTC on their web page is directed at the Players Handbook, the Dungeon Masters Guide, and the Monster Manual. Official errata, because it corrects and updates the core rule books, need to be accounted for during a RAW discussion. Any reference to a rule that does not take into account the errata will be incomplete. (And quite possibly wrong). A more recent printing (which usually includes errata from a previous release) will typically take precedence over one lacking that update/correction. (@Sh4dowPlyr, thanks for making that point).
Whether or not the Sage Advice compendium meets "rules as written" isn't as clear, since within Sage Advice WoTC points out the three levels of rules: Rules as Written, Rules as Intended, and Rules as Fun. I've noticed that most folks treat it as within RAW, but some folks on the GITP forums (for example) spell out why they don't.
As a caveat, for Adventure League play it is important to check for that season's rules treatment, since certain published material either is or isn't eligible for AL play. A RAW issue in AL must account for a given season's boundaries and limitations. This may include official published material like Princes of the Apocalypse/Elemental Evil, The Curse of Strahd, Sword Coast Adventure Guide, and other officially published material. Draft rules and play test like "Unearthed Arcana" are admitted by WoTC to not be in finished form and as such are least likely to be acceptable as a basis for RAW.
1 At a given table it is similar to the AL case: it is common to see some optional rules included or not included based on a DM's decision. For example, in my first 5e campaign the Variant Human rules, and Feats, were closed down by the DM for character creation. (No feats until 4th level). That was RAW for us, as were selected spells from the published Elemental Evil material from WoTC. In our second campaign, the optional DMG rules for facing/flanking/being surrounded were included. This was made explicitly clear by the DM in both cases and, being published rules, were there for reference in published material in case questions/conflicts came up.
(Preface: The below answer was initially written before WOTC's acquisition of D&D Beyond on 2022-04-13. I assume the acquisition would not make my conclusion of 'treat the digital sourcebooks as official' less valid.)
I believe at least the digital versions of the sourcebooks themselves (currently listed here) should be treated as an official rules source roughly on par with the books.
Firstly, WOTC considers D&D Beyond to be an official digital toolset for the game (though, until the acquisition, D&D Beyond wasn't made by WOTC directly, but licensed through them):
This morning, Curse launched D&D Beyond—an official digital toolset for Dungeons & Dragons fifth edition.
(dnd.wizards.com, 2017-08-15)
Secondly, the books on D&D Beyond are considered to be 'digital sourcebooks', which, on their own site, are defined thusly:
A digital sourcebook is a completely digital version of one of the published books, such as the Player's Handbook or adventures like Curse of Strahd. You will get the book re-created in digital format, as well as unlock all of that book's content for use throughout the toolset - both for current tools and anything on the roadmap (such as encounter building/ combat tracking, etc.).
As they are considered a 'completely digital version of one of the published books', I'd say they're as official-source-worthy as said books.
In addition, BadEye (Adam Bradford, D&D Beyond product lead at Curse at the time of posting) also calls D&DB an official source, mentioning that their site is meant to be kept up to date with the rules as new changes come in:
Errata will be incorporated as it comes in. As an official source, it's important that we always stay current.
Ultimately, due to the above, I feel D&D Beyond's version of the sourcebooks should be considered as official as the books themselves. If there's a discrepancy between their content and the most recent errata/printed version of a book, then the book (plus relevant errata) is the 'most canonical', sure, but I don't think the potential for that kind of mismatch/data entry/out of date error would make the rules from the site overall considered 'unofficial'.
Disclaimer: The above only applies to content on D&DB from the official sourcebooks. D&DB also hosts various things that shouldn't be considered official, such as usermade homebrew, forum posts, and unofficial sources such as the Blood Hunter class from Critical Role/Matthew Mercer- these are usually kept separate in the site's navigation. The SRD & Basic Rules are also hosted there in a combined section, but even the WOTC-hosted PDF/printed versions of the SRD is considered unofficial:
The sword of sharpness deals an extra 14 slashing damage when you roll a 20 on its attack roll. The SRD incorrectly says otherwise. Note that the SRD is not an official rules source for D&D. #DnD
@JeremyECrawford, 9:54 PM - 4 Jan 2018
In addition, applicable Unearthed Arcana content was once hosted there (for the UAs released in the range of Jan 8, 2018 to the discontinuation of UA on D&DB around August 2021), which should be treated the same 'officially unofficial' way any other UA content is treated.
While the parts of D&D Beyond that are aggregates of data from the sourcebooks (such as the "Races" section, the "Monsters" section, etc.) contain reproductions of sourcebook data, they seem to be slightly more prone to data entry errors- I'd recommend using the digital sourcebooks' version in the case of finding a conflict between the two.
(On the topic of "what's considered an official sourcebook?", @nitsua60's longstanding question/answer "Where do I find the “official” rules for D&D 5e?" is worth a read as well.)
Best Answer
It should be treated like all other third-party, unofficial content on DM's Guild.
Expanded Racial Feats was authored by Adam "BadEye" Bradford, who leads the D&D Beyond team. It was offered as a preorder bonus for the digital Xanathar's Guide to Everything on D&D Beyond. It was later moved to the homebrew section of D&D Beyond (accessible by all), and offered as a PDF on DM's Guild, where it is labeled as "Community Content" (see this answer for an explanation of the different types of content on DM's Guild).
The purpose of the document is to supplement Xanathar's Guide to Everything by providing racial feats for races that are not part of the PHB, as Xanathar's provides racial feats for the PHB races only.
It was never published by Wizards of the Coast and should be treated the same as other third-party, unofficial content on DM's Guild. It should also not be referred to with XGtE as part of its name, as that is misleading and not how it is named on DMs Guild.