@schibsted/niche-schibsted-account
v0.4.4
Published
This package is a wrapper around `@schibsted/account-sdk-browser` that makes it easier to use for Niche team.
Maintainers
Keywords
Readme
niche-schibsted-account
This package is a wrapper around @schibsted/account-sdk-browser that makes it easier to use for Niche team.
What are additional things it does in coparison to SDK?
- override logout function to allow passing
redirectUrl(window.location.hrefby default) to it. - assigns instance if SDK to
window.Identity- it is used like that by core comments. - sends events for initialization and user change
- runs simplified login logic
- runs auto-login logic
Local development
First install dependencies clone repository, open terminal and run.
npm ciNext start transpiling the source code:
npm run devLinking
Note: order of command execution is important.
In order to make your project available as package locally:
npm linkAnd in project you need:
npm link @schibsted/niche-schibsted-accountSince library has react as peer dependency you need to make sure to pass react manually to the library if you want to use linked version. The easiest way to do so is to declare react as a webpack alias, e.g.
config.resolve.alias.react = path.resolve('./node_modules/react');If the project you use this package in, does not have webpack, you can try https://benjaminwfox.com/blog/tech/why-isnt-npm-link-working#if-you-use-react.
And now you are all good. Your project will now use the local version of niche-schibsted-account instead of the one in node_modules.
