@friendemic/catalyst-chat-widget v0.3.0-next.0
DISTRIBUTION
NOTE:
public/index.htmlshould be updated to reflect changes tosnippet.html&snippet-example.html
See snippet.html for distribution snippet
TESTING A SPECIFIC VERSION
NOTE: Update the
app_idvalue insnippet.htmlto override the production Application
- Update snippet.html URLs to use a specific npm version
- Update
app_idto use the Staging enviornment
app_id: '70C5B4F2-A7CF-4BD6-81C4-68841DE927CC', // Staging
https://cdn.jsdelivr.net/npm/@friendemic/catalyst-chat-widget@1.2.3-next.4/build/static/css/main.css
https://cdn.jsdelivr.net/npm/@friendemic/catalyst-chat-widget@1.2.3-next.4/build/static/js/main.jsPUBLISHING
Acquire a valid .npmrc file for Friendemic.
Helpful commands:
# all-in-one patch and publish with automatic @latest tag
npm version patch && npm publish && git push && git push --tags
# reference for pre-versions: premajor | preminor | prepatch | prerelease
# IMPORTANT! publish with `--tag next`, or else version will have tag @latest
npm version preminor --preid=next # v0.1.0 => v0.2.0-next.0
npm version prerelease # v0.2.0-next.0 > v0.2.0-next.1
npm publish --tag next # IMPORTANT: without `--tag next` package will publish as @latest
npm version patch # v0.1.0-next.1=> v0.1.0 (when used to escape pre-release)
npm publish # escape pre-release and publish with @latest tagFixing accidental publish to @latest
npm unpublish <name>[@<version>]
npm unpublish @yourdomain/your_package@1.1.100
npm unpublish @friendemic/catalyst-chat-widget@1.2.3-next.4Validating @latest version of package
Visit https://semver.npmjs.com/
- pick a package:
@friendemic/catalyst-chat-widget - enter a range:
latestornext- range can be a semver identifier (like found in a package.json dependency) or a tag (
latest,next, etc)
- range can be a semver identifier (like found in a package.json dependency) or a tag (
MIGRATION
From version 0.2.6 => 0.2.8
All previous active systems should remain supported
Changes were made to ratain support for previous configuration techniques
New snippet looks like this:
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/@friendemic/catalyst-chat-widget@latest/build/static/css/main.css" />
</head>
<body>
<!-- place at bottom in root of <body /> element -->
<div id="friendemic_chat_widget" data-client-id="PLACE_ULID"></div>
<script src="https://unpkg.com/@friendemic/catalyst-chat-widget@latest/build/static/js/main.js"></script>
</body>
</html>- The
data-client-idhtml attribute contains the place ulid that identifies which configuration to load. - If
window.CS_WIDGET_CONFIGexists and the request to Glovebox fails, the window config object will be used. - If no configuration can be found, something has gone completely ✋🤧🤚 wonko and the widget will be hidden.
From version 0.2.* => 0.2.6
No action required
Changes are set up to prepare for API, but allows for the previous systems to function
Updated the .env to state both prod and staging APP_IDs for sendbird:
REACT_APP_SENDBIRD_APP_ID_STAGING="" # applies in development enviornment
REACT_APP_SENDBIRD_APP_ID="" # applies during build for productionAdded new window variables
CS_WIDGET_CONFIG: Deprecated will be removedCS_CLIENT_ID: Currently a noop- Used in fetch to retrieve config from non-existent API
- If this has a value, it will fail and use
CS_WIDGET_CONFIGas a fallback
CS_WIDGET_MOCK:- Mock response from faked API, default timeout of 1000ms
window.CS_WIDGET_MOCK = false;
window.CS_CLIENT_ID = '';
window.CS_WIDGET_CONFIG = {};These options are attempted in order.
MOCK
- If
window.CS_WIDGET_MOCK - Uses the mocked API response
FETCH
- If
window.CS_CLIENT_IDexists, attempt to use it. - If the fetch fails, see if there's a
window.CS_WIDGET_CONFIG - If
window.CS_WIDGET_CONFIGdoes NOT exist -- don't render the widget
CONFIG
- If
window.CS_CLIENT_IDdoes NOT exist - Checks for a
window.CS_WIDGET_CONFIG - If
window.CS_WIDGET_CONFIGdoes NOT exist -- don't render the widget
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago