You can set any JS variable in your page context, which becomes available in your included JS file. Here is an example:
var SubscriberKey = "%%=v(@SubscriberKey)=%%";
You can now use SubscriberKey within your JS file, and it will give you the value it gets passed from AMPScript.
I don't know how you retrieve your Subscriber Key, but you can do it like Jonas suggests, using RequestParameter(), e.g.:
var SubscriberKey = "%%=RequestParameter(SubscriberKey)=%%";
The key principle is to set the SubscriberKey JS value before you include your external JS file.
Also, I recommend using CloudPagesURL is your are sending people to this CloudPage from your emails. This will prevent SubscriberKey being disclosed in the URL. Not that important, as you in this case either way will reveal it in HTML, but useful when you only process it in SSJS/AMPScript.