Socket
Socket
Sign inDemoInstall

@layers.digital/layers-portal-sdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@layers.digital/layers-portal-sdk

![npm](https://img.shields.io/npm/v/layers-portal-sdk) ![NPM](https://img.shields.io/npm/l/layers-portal-sdk)


Version published
Weekly downloads
439
increased by8.93%
Maintainers
1
Weekly downloads
 
Created
Source

Layers Portal SDK for JavaScript v1

npm NPM

<script>
window.LayersPortalOptions = {
  appId: "test-app"
}
!function(){var e;window.LayersPortal||(window.LayersPortal=((e=function(n,r){return new Promise((function(t,o){e.q.push([t,o,n,r])}))}).q=[],e.eh={},e.on=function(n,r){var t=e.eh[n]||[];t.push(r),e.eh[n]=t},e.ready=!1,e.readyPromise=new Promise((function(n,r){e.readyPromiseResolve=n,e.readyPromiseReject=r})),e.connected=!1,e.connectedPromise=new Promise((function(n,r){e.connectedPromiseResolve=n,e.connectedPromiseReject=r})),e.platform=null,e.session=null,e.communityId=null,e.accountId=null,e.userId=null,e));var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://js.layers.digital/v1/LayersPortal.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r)}();
</script>

Example:


LayersPortal.on('ready', function () {
  // Called when SDK is ready
})

LayersPortal.on('connected', function (data) {
  /**
  data = {
    session: ...
    userId: ...
    communityId: ...
    accountId: ...
  }
  */

  // Called when SDK connects with Layers
})

/* Closing window */
const promise = LayersPortal('close')

/* Using async/await */
try {
  const result = await promise
  // Use result
} catch (error) {
  // Handle errors
}

/* Using then/catch */
promise.then(result => {
  // Use result
}).catch(error => {
  // Handle errors
})

FAQs

Package last updated on 28 Apr 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc