Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@layerhq/web-xdk
Advanced tools
The Layer eXperience SDK for Web provides a library for talking to Layer Services, and a library of widgets to simplify adding chat capabilities into your application.
Browser | Version | OS Tested Against |
---|---|---|
Internet Explorer | 11.0 | Windows 8.1 |
Edge | 13.0 | Windows 10 |
Edge | 14.0 | Windows 10 |
Safari | 10.0 | OSX 10.12 |
Safari | 9.0 | OSX 10.11 |
Safari (IOS) | 9.x | IOS 10.0 |
Safari (IOS) | 10.0 | IOS 9.3 |
Chrome | 55 | OSX 11.0 |
Chrome | 48 | Linux |
Firefox | 51 | OSX 11.0 |
Firefox | 50 | Windows 8 |
Older versions of Safari do not support Websockets and will not work with the Layer WebSDK.
The Layer Web XDK provides a library of widgets to simplify adding chat capabilities into your application.
It is implemented using the Webcomponents Polyfill; in particular, this project uses the "light" version of the polyfill which means we do not use Shadow Dom.
<script src='https://cdn.layer.com/xdk/0.9/layer-xdk.min.js'></script>
<link rel='stylesheet' href='https://cdn.layer.com/xdk/0.9/themes/layer-basic-blue.css' />
<script>
var client = window.layer.init({
appId: 'layer:///apps/staging/UUID'
});
</script>
Alternatively, a separate theme and templates can be loaded using:
npm install @layerhq/web-xdk --save
var Layer = require('layer-xdk');
const client = Layer.init({
appId: 'layer:///apps/staging/UUID'
});
<link rel='stylesheet' href='node_modules/xdk/themes/build/layer-basic-blue.css' />
grunt develop
: Starts a webserver for running tests or sample apps, and watches for changes, rebuilding source and theme on any changegrunt docs
: Generate API Reference docs into folder ~/docs
grunt theme
: Generate CSS files from the .less
filesgrunt debug
: Generate all lib folders and basic build files.grunt build
: Run's grunt debug
and grunt theme
and then generates all minified filesgrunt coverage
: Generate a coverage test build; additional steps shown below for running a coverage testgrunt develop
will start a local webserveropen samples/cards.html
will start a simple sample app; you may need to customize identity providers. This simple example does not yet have UIs for creating new conversations; from the console you can client.createConversation({participants: ["user_a"]}).send()
To run coverage tests:
grunt coverage
will write test/coverage-build.js
with an instrumented version of the build filehttp://localhost:8004/test/CoverageRunner.html
coverageResults = {};
Object.keys(__coverage__).forEach(key => {
// Simplify reporting paths by taking 'lib' out of the path
var newKey = key;
// Many components have a path of components/component_name/component_name.js;
// simplify reporting of paths to components/component_name.js
newKey = newKey.replace(/components\/.*\//, "components/");
var parts = newKey.split(/\//);
if (parts[parts.length-2] + '.js' == parts[parts.length-1]) {
parts.splice(parts.length-2, 1);
newKey = parts.join('/');
} else if (newKey.match(/\/ui\/cards\/[^/]+\/[^/]+\.js$/)) {
newKey = newKey.replace(/(\/ui\/cards\/)([^/]+\/)([^/]+\.js)$/, "$1$3");
console.log("newKey: " + newKey);
}
coverageResults[newKey] = __coverage__[key];
})
copy(JSON.stringify(coverageResults))
coverage/coverage.json
istanbul report --root coverage --dir coverage/report html
open coverage/report/index.html
ConversationPanel.composeButtons
one must dom create elements,
put them in an array and then set composeButtons
to refer to them. This is especially bad in React. A better mechanism should be discussed,
and implemented.FAQs
The Layer eXperience SDK for Web provides a library for talking to Layer Services, and a library of widgets to simplify adding chat capabilities into your application.
The npm package @layerhq/web-xdk receives a total of 7 weekly downloads. As such, @layerhq/web-xdk popularity was classified as not popular.
We found that @layerhq/web-xdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 27 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.