Beyond Identity JS SDK
Embedded
Offering the entire experience embedded in your product. Users will not need to navigate to the Beyond Identity Authenticator.
Installation
yarn add @beyondidentity/bi-sdk-js
or
npm install @beyondidentity/bi-sdk-js
The next step differs based on the framework you are using and requires you to copy our .wasm
binary into a location where it can be fetched publicly.
React
Add the following to your package.json:
"scripts": {
...
"copy:wasm": "cp -R ../node_modules/@beyondidentity/bi-sdk-js/coresdk/dist/*.wasm public",
"build": "yarn copy:wasm && <build steps>",
...
}
Angular
Add the following to your package.json:
"scripts": {
...
"copy:wasm": "cp -R node_modules/@beyondidentity/bi-sdk-js/coresdk/dist/*.wasm src/",
"build": "yarn copy:wasm && ng build",
...
}
Go into node_modules/@beyondidentity/bi-sdk-js/coresdk/dist
and keep note of the name of the .wasm
file.
Add the .wasm
file to your assets
in angular.json
:
"assets": [
...
"src/kmc_bg.<hash>.wasm",
...
],
Usage
import * as embeddedsdk from "@beyondidentity/bi-sdk-js";
async function initialize(): Promise<embeddedsdk.Embedded> {
return embeddedsdk.Embedded.initialize();
}
Check out the documentation for more information.
Example App
git clone git@github.com:gobeyondidentity/bi-sdk-js.git
cd bi-sdk-js
yarn install && yarn build
cd examples/app/js
yarn install && yarn build && yarn start
Then open the example app here.