Unfortunately, good advice on this is going to be very hard to receive on hn/reddit etc. Discussions of how to do this properly require a lot of fine details. A good introduction to this would be via the link posted by mooreds:
http://craphound.com/msftdrm.txt
Moxie Marlinspike's older post on the cryptographic doom principle, at http://www.thoughtcrime.org/blog/the-cryptographic-doom-prin... also covers some of the basics.
You're much, much better off getting expert advice on this from folks familiar with your SPA/JS Framework.