Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@authorizerdev/authorizer-js
Advanced tools
[`@authorizerdev/authorizer-js`](https://www.npmjs.com/package/@authorizerdev/authorizer-js) is universal javaScript SDK for Authorizer API. It supports:
@authorizerdev/authorizer-js
is universal javaScript SDK for Authorizer API.
It supports:
2.x
version of @authorizerdev/authorizer-js
has a uniform response structure that will help your applications to get right error codes and success response. Methods here have {data, errors}
as response objects for methods of this library.
For 1.x
version of this library you can get only data in response and error would be thrown so you had to handle that in catch.
All the above versions require Authorizer
instance to be instantiated and used. Instance constructor requires an object with the following keys
Key | Description |
---|---|
authorizerURL | Authorizer server endpoint |
redirectURL | URL to which you would like to redirect the user in case of successful login |
Example
const authRef = new Authorizer({
authorizerURL: 'https://app.herokuapp.com',
redirectURL: window.location.origin,
});
<script src="https://unpkg.com/@authorizerdev/authorizer-js/lib/authorizer.min.js"></script>
Authorizer
instance and access various methods<script type="text/javascript">
const authorizerRef = new authorizerdev.Authorizer({
authorizerURL: `AUTHORIZER_URL`,
redirectURL: window.location.origin,
clientID: 'YOUR_CLIENT_ID', // can be obtained from authorizer dashboard
});
// use the button selector as per your application
const logoutBtn = document.getElementById('logout');
logoutBtn.addEventListener('click', async function () {
await authorizerRef.logout();
window.location.href = '/';
});
async function onLoad() {
const { data, errors } = await authorizerRef.authorize({
response_type: 'code',
use_refresh_token: false,
});
if (data && data.access_token) {
// get user profile using the access token
const { data: user, errors } = await authorizerRef.getProfile({
Authorization: `Bearer ${res.access_token}`,
});
// logoutSection.classList.toggle('hide');
// userSection.innerHTML = `Welcome, ${user.email}`;
}
}
onLoad();
</script>
npm i --save @authorizerdev/authorizer-js
OR
yarn add @authorizerdev/authoirzer-js
const { Authorizer } = require('@authorizerdev/authoirzer-js');
const authRef = new Authorizer({
authorizerURL: 'https://app.heroku.com',
redirectURL: 'http://app.heroku.com/app',
});
async function main() {
await authRef.login({
email: 'foo@bar.com',
password: 'test',
});
}
npm i --save @authorizerdev/authorizer-js
OR
yarn add @authorizerdev/authorizer-js
import { Authorizer } from '@authorizerdev/authorizer-js';
const authRef = new Authorizer({
authorizerURL: 'https://app.heroku.com',
redirectURL: 'http://app.heroku.com/app',
});
async function main() {
await authRef.login({
email: 'foo@bar.com',
password: 'test',
});
}
pnpm install
pnpm build
to build the librarypnpm test
to run the testspnpm release
to release a new version of the libraryFAQs
[`@authorizerdev/authorizer-js`](https://www.npmjs.com/package/@authorizerdev/authorizer-js) is universal javaScript SDK for Authorizer API. It supports:
The npm package @authorizerdev/authorizer-js receives a total of 206 weekly downloads. As such, @authorizerdev/authorizer-js popularity was classified as not popular.
We found that @authorizerdev/authorizer-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.