@guardian/permissions-client
v0.0.4
Published
Client for Guardian's permissions service
Keywords
Readme
@guardian/permissions-client
Client for reading Guardian user permissions data in Node.js services
Installation
npm install @guardian/permissions-clientor
pnpm add @guardian/permissions-client(@aws-sdk/client-s3 and @aws-sdk/credential-providers must also be installed)
Usage
import { init } from '@guardian/permissions-client';
const { hasPermission } = init({ isRunningLocally: true });
const doesLiamHaveGridAccess = await hasPermission(
'grid_access',
'[email protected]',
);Releasing
The Node client library is published to NPM using Changesets
Please follow semver principles:
- Patch: bug fixes and backwards-compatible changes.
- Minor: backwards-compatible new features.
- Major: breaking changes.
Run
npx changesetto create a changeset when you make changes that should be included in a release.- Follow the prompts to describe your changes, ensuring you choose
node-clientas the package being release, and select the appropriate version bump (patch, minor, major). - This will generate a markdown file in the
.changesetdirectory. - Commit the changeset file along with your code changes.
- Follow the prompts to describe your changes, ensuring you choose
Once your changes are merged into the
mainbranch, the changeset will be picked up in the next release cycle, and the version will be bumped accordingly and the package released once the generated🦋 Release package updatesPR is merged.You can also create a canary release from a branch by opening a PR and adding the
🐥 Canarieslabel, this can be useful for testing your changes with a downstream project before creating a production-ready release.
