How to use OAuth 1.0a signature generator with Angular2+

I am going to create Angular application for working with flickr. So I need to generate a signature for a consumer. It is seemed to me, that the best way is to install oauth 1.0a signature generator . So I have done it "npm i oauth-signature". But I do not not know how to use it correctly. I mean - should I add any information to angular.json or package.json files? Any Dependency Injections? How to use oauthSignature.generate() method in a proper way? -

Upvotes: 2

Views: 279

Answers (1)

Ishraq Ahmad
Ishraq Ahmad

Reputation: 1327

If you run this command, then you don't need to change angular.json or package.json file.

npm i oauth-signature --save

Next step is to import it in your ts file. Like this,

import * as oauth from 'oauth-signature';

then call oauthSignature.generate method.

Upvotes: 1

Related Questions