@pcgbros/pbplus-member-sdk

2.14.9 • Public • Published

pbplus-member-sdk

API sdk of PBPlus member plugin.

Behaviors

  • Update getState().pbplusMemberCenter.userUuid by url (token_id) or cookie.
  • Dock to pbplus auth, member and memberCenter api, with url passed by store.

You can

  • Display member center by dispatch(PbplusMemberCenter.Actions.display()).
  • Update active tab by dispatch(PbplusMemberCenter.Actions.updateActiveTab('TAB_NAME')).
    • Possible TAB_NAMEs are notice-center, calendar, point-counter, buying-logs and personal-data.
    • See MemberCenterComonent for furtuer information.
  • Check auth state by dispatch(PbplusMemberCenter.Actions.checkAuthState({ clientId })).
  • Update user uuid in cookie and store by dispatch(PbplusMemberCenter.Actions.updateUserUUID({ uuid })).
  • Renew user uuid in cookie and store randomly by dispatch(PbplusMemberCenter.Actions.renewUserUUID()).

These values in redux store will be read.

const store = createStore(
    reducer,
    {   
        pbplusMemberCenter: {
            baseUrl: {
                auth: process.env.AUTH_BASE_URL,
                member: process.env.MEMBER_BASE_URL,
                memberCenter: process.env.MEMBER_CENTER_BASE_URL,
            }   
        }  
    }
);

Start demo server

cd demo/
npm install
npm start

Publish package

cd /pbplus-member-sdk
npm version
npm publish

Before bundle

  • Check react, react-redux, react-dom have been installed in your project. This package is not bundled with above packages.

Readme

Keywords

Package Sidebar

Install

npm i @pcgbros/pbplus-member-sdk

Weekly Downloads

1

Version

2.14.9

License

MIT

Unpacked Size

644 kB

Total Files

15

Last publish

Collaborators

  • pcg-leo
  • joeytsai301
  • hao_yu