Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation missing create() function #5

Open
robertvorthman opened this issue Jul 11, 2016 · 1 comment
Open

Documentation missing create() function #5

robertvorthman opened this issue Jul 11, 2016 · 1 comment

Comments

@robertvorthman
Copy link

Thanks for making this. I think your documentation is missing the step where create() should be called, otherwise node throws an error about GS not having a sign method. This is the code that worked for me:

var GS = require('gmaps-signature');
var uriSigner = GS.create();
uriSigner.GMAPS_CLIENT_ID = myId;
uriSigner.GMAPS_PRIVATE_KEY = myKey;
var signedUri = uriSigner.sign(requestUri);
@louy
Copy link
Contributor

louy commented Jul 11, 2016

You're welcome.

Good point. We've switched to ES6 modules and apparently forgot to update the readme file.
Basically it should be like this:

var GS = require('gmaps-signature').default;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants