I would like to add a GFCI protected receptacle in a bathroom that only has a light switch. I purchased a Leviton GFSW1-STW. The power comes from the light. See second image (credit for image from www.do-it-yourself-help.com) I only need the receptacle GFCI protected. Is this possible. Thanks.
Any receptacle needs always-hot for power, and neutral to return the power (complete the circuit/loop).
As you can see from that diagram, there is always-hot (white marked black with tape) and switched-hot (black natural). No neutral. A switch and receptacle will not happen with any diagram or method from this school of thinking.
Take the device back, you definitely will not be using it.
Anyway, because of the complexity of this one, we will need to divide and conquer: solve the receptacle problem separate from the GFCI problem. If you have a realtor or home inspector who says "it isn't GFCI unless I see the test and reset buttons", fire them, they stink at details and that is a detail business.
Pull chain for the lamp
Don't laugh, this is the basis for every other strategy. In this case you convert the cable between lamp and former switch to carry always-hot and neutral. Power the receptacle in the normal fashion.
And then you get a lamp with a pull chain. Of course this would probably violate Code in most of the civilized world.
A wireless light switch
This wires like the pull chain, but uses a smart module in the lamp base. The module listens to any of a variety of smart home technologies, which do their communication via radio or powerline induction. These talk to either a wireless switch that glues to the wall (freeing up your entire receptacle for a common GFCI unit) -- or a combo smartswitch-receptacle that fits where you want.
In the latter case, the chance of finding a product which is a trifecta of smart-switch, receptacle AND GFCI device is rather remote. We'll need to go external GFCI protection.
External GFCI protection
GFCI is a system of protection. At the heart of the matter, it is a "black box" with two line wires coming in, and two load wires going out. That black box can be anywhere.
The most obvious is a GFCI breaker. This replaces the circuit breaker and provides both overload and GFCI protection, and protects the entire circuit.
Another Rather Useful package is the Dead Face. This is a receptacle style with the sockets blanked out. It forces you to think in terms of the black-box, with its LINE side and LOAD side that protects everything downline.
So if all else proves unviable, we protect this receptacle by placing it downline of a GFCI protector. Follow the wiring back in the direction of the panel and look for an opportune place to do that. If you can find a receptacle location, replace it with a Dead Face.**
If you can't find a receptacle location, use a GFCI breaker.
There'll be no way to avoid protecting both the receptacle and lamp. If your lamp is tripping ground faults, then dear God, replace it! You're in a bathroom, ground faults kill people there!
Bust up drywall
One option is to run another cable between light and switch. A /3 cable would suffice. It would carry always-hot (black), switched Hot (red) and neutral (white). Now you can use your original device, but cover up and do not use the load side of the GFCI. Join one switch wire to the switched-hot and the other to always-hot.
While you're at that, you could change the switch box to a 2-gang box which would allow use of a normal light switch and cheaper GFCI receptacle.
** just to be honest, I would never use a Dead Face. I would just use the cheaper, more common Live Face and put electrical tape across the face as a mnemonic to remind myself to solve the problem without using those.
The TL;DR to Harper's answer is this
You don't have a neutral at your light switch. You have a
- Hot (white)
- Switched Hot (black)
This is the diagram that comes with that particular device
Don't cheat and use the ground as a neutral (then you have a bare wire that's potentially energized and no ground). If you're bound and determined to use this light/switch then pull some 14/3 (or 12/3 if it's 20A) so you have a dedicated neutral.