@covered/components
v0.1.13
Published
1. Installation through NPM:
Maintainers
Keywords
Readme
Components
Installation through NPM:
Use the following command to install the SDK through NPM:
npm i @covered/componentsCreate an
AuthLeaseCallback:Please create the asynchronous
AuthLeaseCallbackas follows:const authLeaseCallback = async (): Promise<AuthLeaseResponse> => { const { data }: { data: AuthLeaseResponse } = await axios.post('/api/auth/covered'); return data; };Custom Theme Creation (Optional):
You can develop a custom theme for the SDK as shown below:
const customTheme: Theme = { brandName: 'PEX', logoUrl: 'https://assets.itscovered.com/partners/pex/PEX-transparent.png', redirectUrl: '', color: '#488FA2', coBranded: false, };Import SDK CSS classes:
Add the below import statement in your
main.tsxfile to import SDK CSS classes:import '../node_modules/@covered/components/style.css';Instantiate the Component by passing the
customThemeandauthLeaseCallbackas props:<PolicyRetrieve theme={customTheme} authLeaseCallback={authLeaseCallback} />Sandbox Development
For testing purposes, you can use the sandbox development mode which will return mock data. To achieve this, pass the
environmentargument to the component with theEnvironment.SANDBOXvalue as shown below:
<PolicyRetrieve
environment={Environment.SANDBOX}
theme={customTheme}
authLeaseCallback={authLeaseCallback}
/>- Sandbox Testing Credentials You can utilize the following credentials to return testing policies:
- Username: user_good_home
- Password: pass_good
Follow the above steps, and you will be able to use the @covered/components within your application.
