@descope/web-component
Create your login pages on our console-app, once done, you can use this library to inject those pages to your app
it registers- a web component and update the web-component content based on the relevant page,
See usage example below
Usage
Install the package
npm install @descope/web-component
As a library
import '@descope/web-component'
import { DescopeWc }
render(){
return (
<descope-wc project="myProjectId"/>
)
}
In HTML file
<head>
<script src="./my-lib.umd.production.min.js"></script>
</head>
- Now you can add the custom element to your HTML
<descope-wc project-id="<project-id>" flow-id="<flow-id>"></descope-wc>
Run the demo app
- Install dependencies -
npm i
- Create a
.env
file and add the following parameters:
// .env
DESCOPE_BASE_URL=<base-url>
DESCOPE_FLOW_ID=<flow-id>
DESCOPE_PROJECT_ID=<project-id>
- Run application -
npm run start
TODO: we should host this file so it can be included without installing the package, once we will publish it to a public registry, we can also use unpkg.com/ to serve it
Optional Attributes
Attribute | Available options | Default value |
---|
theme | "light" - Light theme "dark" - Dark theme "os" - Auto select a theme based on the OS theme settings | light |
debug | "true" - Enable debugger "false" - Disable debugger | "false" |
| | |