Web SDK
A front end SDK for integration with Igloo apps and widgets
Table of Contents
- About The Project
- Getting Started
- Usage
- Publishing
About The Project
The Web SDK project is designed as an NPM package that can be imported into any of the various apps and widgets of Igloo. It provides common methods and functionality such as user auth, making API calls, snackbar notifications, etc.
Built With
Getting Started
To set up the project locally for development:
- Clone the repo
git clone https://github.com/igloosoftware/web-sdk.git
- Install NPM packages
npm install
Usage
To use the sdk in your Igloo apps and widgets, run the following in your project folder:
npm i @igloosoftware/web-sdk
You can then import any required methods into your project as usual:
import { getAuthInfo, useSnackbar } from "@igloosoftware/web-sdk";
Publishing
To publish a new version of the project, you will first need to configure npm and login to your account:
- If you do not have an account at npmjs.com, register a new one and set up 2 factor authentication (see the npmjs docs for instructions).
- After registering, you will need to request an admin to grant you access to npmjs @igloosoftware
- Login to your account on the command line using
npm login
- Ensure the correct registry is set in your config file. Run
npm config list
to see your current settings or run npm config set registry="https://registry.npmjs.org/"
to set your registry if needed. - In the package.json file in the web-sdk project folder, increment the package version in order to publish a new version to npm. For example,
"version": "0.1.45"
becomes "version": "0.1.46"
for a patch update. - In the project folder, run
npm run build
- Still in the project folder, run
npm run publish
. You should get an email from npm shortly to confirm that a new version was successfully published. - Once testing is complete, create a PR.