Tool for validate AdMob SSV signatures from backend
- Node >= 12.0.0
Install via NPM
$ npm install --save @exoshtw/admob-ssv
Or Yarn
$ yarn add @exoshtw/admob-ssv
Use as ES module:
import url from 'url';
import http from 'http';
import Verifier from '@exoshtw/admob-ssv';
const verifier = new Verifier();
const server = http.createServer(async (request) => {
const parts = urls.parse(request.url, true);
const isValid = await verifier.verify(parts.query);
// ...
});
Example with express
import Verifier from '@exoshtw/admob-ssv';
const verifier = new Verifier();
app.get('/ssvcallback', (req, res, next) => {
verifier.verify(req.query)
.then((isValid) => {
if (!isValid) {
res.status(500);
res.json({
error: 'Invalid signature',
});
}
// ...
})
.catch((e) => {
return next(e);
});
});
Clone git repo:
$ git clone git@github.com:exoshtw/node-admob-ssv.git
Install deps
$ npm install -d
or
$ yarn
This lib use Jest for testing, for run this use:
$ npm test
We use SemVer for versioning. For the versions available, see the releases on this repository.
- exos - Initial work - exos
This project is licensed under the GPL-2.0 License.
- Bug reports and pull request are welcome 😊
- Buy me a beer 🍺: BTC 14NvJxpQsxs4EK8MTq2rubTDwuy54uCesu