Socket
Socket
Sign inDemoInstall

@ant-credit/bean-sdk

Package Overview
Dependencies
6
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ant-credit/bean-sdk

bean 组件 sdk


Version published
Maintainers
2
Install size
2.37 MB
Created

Readme

Source

@ant-credit/bean-sdk

bean 组件 sdk

安装依赖

npm i @ant-credit/bean-sdk --save

代码中使用

添加组件挂在节点
<body>
  <div id="BusinessInfo_PC"></div>
</body>
初始化 bean-sdk 并调用组件
import beanSdk from '@ant-credit/bean-sdk';
import { getMockComponentToken } from './your-own-utils';

async function main() {
  const componentToken = await getMockComponentToken(); // replace with your own get componenttoken function

  if (!componentToken) {
    return;
  }

  await beanSdk.init({
    componentToken,
  });

  const BusinessInfo_PC_Component = await beanSdk.create({
    name: 'BusinessInfo_PC',
    props: {
      crn: '911000001000013428',
      useInnerDataSource: true,
    },
    style: `
      body {
        width: 900px !important;
      }
    `,
  });
  BusinessInfo_PC_Component.render('#BusinessInfo_PC');
}

main();

SDK API

beanSdk 实例

beanSdk.init(param)
  • param
    • componentToken
    • debug
    • globalEnv
    • onComponentTokenExpired
beanSdk.create(param)
  • param
    • name
    • props
    • style
    • globalEnv
beanSdk.render(container)
  • container

FAQs

Last updated on 08 Jul 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc