@mewtant/admob-ssv
v0.3.0
Published
Tool for validate AdMob rewarded ads signatures SSV
Downloads
9,895
Maintainers
Readme
AdMob rewarded ads SSV for Node.js
Tool for validate AdMob SSV signatures from backend
Getting Started 🚀
Prerequisites 📋
- Node >= 12.0.0
Installing 🔧
Install via NPM
$ npm install --save admob-ssvOr Yarn
$ yarn add admob-ssvUsage 📦
Use as ES module:
import url from 'url';
import http from 'http';
import Verifier from '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 '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);
});
});
Example: Passing custom parameters
import Verifier, { KeyProvider, MemoryCache, RetryFetcher } from 'admob-ssv'
const verifier = new Verifier({
keyProvider: new KeyProvider({
cache: new MemoryCache(),
fetcher: new RetryFetcher(),
}),
})Versioning 📌
We use SemVer for versioning. For the versions available, see the releases on this repository.
Credit to Original Author ✒️
- exos - Initial work - exos
License 📄
This project is licensed under the GPL-2.0 License.
Acknowledgments
- Bug reports and pull request are welcome 😊
- Buy me a beer 🍺: BTC 14NvJxpQsxs4EK8MTq2rubTDwuy54uCesu
