# @soulmachines/smwebsdk

The Soul Machines Web SDK can be used for presenting and interacting with Digital Heroes in a web page or front-end JavaScript application.

You will need access to a Soul Machines Digital Hero to use this library.

Full documentation can be found in the [Soul Machines Support Portal](https://public-assets.cdn.soulmachines.cloud/index.html).

## Installation

```
npm install @soulmachines/smwebsdk
```

## Usage

```
import { smwebsdk } from '@soulmachines/smwebsdk'
```

See the [Soul Machines Support Portal](https://public-assets.cdn.soulmachines.cloud/index.html) for further documentation.

## License

Please see the [End User Licence Agreement](LICENSE.md) included with the code.

## Release

The web sdk is released using github actions.

Releases are stored here: https://github.com/soulmachines/smwebsdk/releases.

There are three key actions to consider during release:

1. [Draft release PR](https://github.com/soulmachines/smwebsdk/actions/workflows/draft-release-pr.yml). 
   On merge to main this action creates a draft PR using Google's [release-please](https://github.com/googleapis/release-please) action. 
   This identifies changes as fixes and features to update release notes, creates a github release and assigns a new semver version into package.json.
   As more changes are merged release-please automatically updates the PR.
   When the release is ready to be made, the PR can be promoted from draft, approved and merged
2. [Publish to Github Packages](https://github.com/soulmachines/smwebsdk/actions/workflows/publish-to-gh-packages.yml). This action runs automatically on release (triggered by release-please PR merge) and will update the package registry in github. It can also be run manually.   
3. [Publish to npm](https://github.com/soulmachines/smwebsdk/actions/workflows/publish-to-npm.yml). This is a manual run github action. Take the version number assigned by the release-please PR's merge (in package.json) and specify it as a parameter to this job: Release tag name to publish (eg. v1.0.0).
   Publishing to npm makes the release publicly available to customers.
  
