
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@ballerine/web-ui-sdk
Advanced tools
Ballerine is an open-source infrastructure for user identity and risk management. Compose verification processes for any vertical and geography using modular building blocks, components, and 3rd party integrations.
Web SDK Flows can generate custom made, branded flows to collect KYC/KYB documents and user information. The SDK UI is embeddable inside existing apps or deployed as an webapp.
Why you should use Ballerine's flows:
Live examples: KYC 1, KYC 2, KYB
Demo project: View in jsfiddle
CDN:
Add this code to your index.html header
<script
async
src="https://cdn.ballerine.io/1.1.22/ballerine-sdk.umd.min.js"
integrity="sha384-cHxaE8mk7COVrdyKoDw4cdPC6PLoMItItHZ+LwA18bDaiWJLxV2f2zyVf6Q9Vtww"
crossorigin="anonymous"
type="module"
></script>
Package Managers:
# NPM
npm install --save @ballerine/web-ui-sdk
# Yarn
yarn add @ballerine/web-ui-sdk
# PNPM
pnpm add @ballerine/web-ui-sdk
Config Parameter | Type | Description |
---|---|---|
uiConfig | FlowsUIConfig | Initializing flows, preloading needed assets and ui packs |
endUserInfo | EndUserInfo | Use data like ID, name etc.. |
backendConfig | FlowsBackendConfig | Backend endpoint the flows should interact with |
translations | FlowsTranslations | Change the config after init function |
CDN: Add this code to your index.html header
// 1. Add script (see installation)
// 2. Initialize SDK & flows (see configuration)
BallerineSDK.flows.init({...}).then(() => {
console.log('flows ready');
// 3. Mount selected flow on an element
BallerineSDK.flows.mount('my-kyc-flow', 'flow-host-element', {});
});
// 4. Listen to finish event (see events)
BallerineSDK.flows.on('finish', doSomethingFn)
Package Manager:
import { flows as ballerineFlows } from '@ballerine/web-ui-sdk';
await ballerineFlows.init({...}).then(() => console.log('flows ready'));
// 3. Mount selected flow on an element
ballerineFlows.mount('my-kyc-flow', 'flow-host-element', {});
// 4. Listen to finish event (see events)
ballerineFlows.on('finish', doSomethingFn)
Code example:
<script
src="https://cdn.ballerine.io/1.1.22/ballerine-sdk.umd.min.js"
integrity="sha384-cHxaE8mk7COVrdyKoDw4cdPC6PLoMItItHZ+LwA18bDaiWJLxV2f2zyVf6Q9Vtww"
crossorigin="anonymous"
type="module"
></script>
<script>
const initConfig = {
"flows": { "my-kyc-flow": {
"steps": [
{"name": "welcome", "id": "welcome" },
{ "name": "document-selection", "id": "document-selection",
"documentOptions": ["id_card", "drivers_license", "passport"]},
{ "name": "document-photo", "id": "identity-document-shot" },
{ "name": "check-document", "id": "identity-document-user-check" },
{ "name": "document-photo-back-start", "id": "document-photo-back-start"},
{ "name": "selfie", "id": "selfie"},
{ "name": "check-selfie", "id": "check-selfie" },
{ "name": "loading", "id": "custom-loader" }
]}
}
}
BallerineSDK.flows.init(initConfig).then(() => {
BallerineSDK.flows.mount('my-kyc-flow', 'flow-host-element', {});
});
}
</script>
The approach to native apps are all the native functionalities happens inside Ballerine native sdks (Android, iOS) while and the representation layer is still an web app (inside a native webview).
This way we can enjoy both worlds:
See Android and iOS repositories for guidance:
Customize the UI, the flow's steps and the backend.
Flow Initialization:
BallerineSDK.flows.init([CONFIG])
Config Parameter | Type | Description |
---|---|---|
uiConfig | FlowsUIConfig | Initializing flows, preloading needed assets and ui packs |
endUserInfo | EndUserInfo | Use data like ID, name etc.. |
backendConfig | FlowsBackendConfig | Backend endpoint the flows should interact with |
translations | FlowsTranslations | Change the config after init function |
Running a flow:
BallerineSDK.flows.mount('my-flow', elementId, [CONFIG]);
// or
BallerineSDK.flows.openModal('my-flow', [CONFIG]);
Config Parameter | Type | Description |
---|---|---|
callbacks | FlowsCallbacksConfig | An object containing callback methods (see below) |
Config Parameter | Type | Description |
---|---|---|
onFlowComplete | IFlowCompletePayload | User completed the flow |
onFlowExit | IFlowExitPayload | User quits the flow (back button on the first page or pressed close buttons) |
onFlowError | IFlowErrorPayload | Unexpected errors |
onFlowNavigationUpdate | IFlowNavigationUpdatePayload | User moved between steps |
Flows UI can be configured in three levels:
Config Parameter | Type | Description |
---|---|---|
uiPack | string - Name or URL | Ui Pack is a complete bundles of styles, assets and translations |
theme.general | FlowsGeneralTheme | General colors, paddings, fonts.. |
Config Parameter | Type | Description |
---|---|---|
theme.layout | FlowsGeneralTheme | Global layout css |
theme.paragraph | FlowsGeneralTheme | Global paragraph css |
theme.button | FlowsGeneralTheme | Global button css |
... See more |
Config Parameter | Type | Description |
---|---|---|
theme.flows['FlowName'].step | ICSSProperties | Step includes style object and styles for each element |
... See more |
As the level is lower it will override the upper ones
Config Parameter | Type | Description |
---|---|---|
remoteUrl | string (URL) | Get a full translation json from remote url |
overrides | Record<string, string> | Override default translations or remote translations |
Config Parameter | Type | Description |
---|---|---|
baseUrl | string (URL) | Backend base URL |
auth | BEAuthConfig | Auth method and Authorization header |
endpoints | BEEndpoints | List of endpoints for each action |
FAQs
Ballerine is an open-source infrastructure for user identity and risk management. Compose verification processes for any vertical and geography using modular building blocks, components, and 3rd party integrations.
We found that @ballerine/web-ui-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.