@withjoy/sdk-js
v0.2.1
Published
Joy Javascript SDK
Maintainers
Readme
Joy Javascript SDK
Auth host hook
delegate_withRefreshToken, delegate_withIdToken and tokenInfo call withjoy.auth0.com by default.
The page can point them elsewhere by setting a resolver on window.__withjoyAuthHostResolver
(global.__withjoyAuthHostResolver outside the browser):
// () => string | Promise<string>, returning a bare hostname. Consulted on every call.
window.__withjoyAuthHostResolver = function () { return resolveAuthHostFromFlag(); }; // e.g. "auth.withjoy.com"It is a page global rather than an import because each app bundles its own copy of the SDK.
Only withjoy.auth0.com, auth.withjoy.com and auth-dev.withjoy.com are accepted.
If the resolver is missing or not a function, calls go to withjoy.auth0.com. If it throws, rejects or returns any other
value, they also go to withjoy.auth0.com and the SDK logs a console.warn.
The SDK does not read feature flags itself.
Installing or Upgrading Packages
Please follow the Best Practices for Care & Feeding of 'npm-shrinkwrap.json'.
Presently, the 'npm-shrinkwrap.json' can be successfully re-generated using Node 6 + npm@3.
There is no need to switch to Node 10 + npm@6, as the Wiki above suggests.
If the above fails:
Switch to node 16
nvm use 16Run yarn instead of npm
yarn install --frozen-lockfileSwitch back to node 6.9
nvm useTest to verify an working bulid
npm testPublishing
To publish a new version of this module,
- do not up-version on your development branch
- merge your fixes into
main - from the
mainbranch,
npm version patch # or whatever is suitableSee npm's examples of the different levels of versions (major, minor, patch, etc.)
As a verification step (via 'preversion'),
- a fresh (local) build is produced
- the Test Suite must pass
As a follow-up,
package.jsonis up-versioned- a semver-ish tag is pushed to Git
- CircleCI will perform the
npm publishoperation when it detects the tag - it's ready once the 'versions' in
npm info @withjoy/sdk-jshave been updated
CircleCI
Its Project uses the following Environment Variables:
- ARTIFACTORY_TOKEN
- NPM_TOKEN
