Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@notabene/javascript-sdk
Advanced tools
This library is the JavaScript SDK for loading the widget on a frontend.
There are two options for loading the Notabene SDK:
<script id="notabene" async src="https://unpkg.com/@notabene/javascript-sdk@1.9.0/dist/index.js"></script>
Or installing the library:
yarn add @notabene/javascript-sdk
Create a new Notabene instance:
const notabene = new Notabene({
widget: 'https://widget.notabene.id',
container: '#container',
authToken: '{CUSTOMER_TOKEN}'
onValidStateChange: (isValid) => {
// Use this value to determine if the transaction is ready to be created.
console.log('is transaction valid', isValid);
}
});
Then render the widget:
notabene.renderWidget();
To update the widget as users enter transaction details:
notabene.setTransaction({
asset: 'ETH',
beneficiaryAddress: '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819',
amount: '2000000000',
})
Once the widget determines the transaction is valid, it will call the onValidStateChange
callback, to access the transaction details:
const currentTransactionInfo = notabene.tx
Theme
Pass a theme
object when creating an instance
Here you can pass configuration which will customize the styles of the widget to meet your brand needs, all values are optional.
{
primaryColor: '#fff',
secondaryColor: '#fff',
fontFamily: Arial,
logo: {LOGO_URL},
}
To get a list of supported fonts, visit https://fonts.google.com/
Dictionary
Pass a dictionary
object mapping in text in the widget to your own language, for example:
To replace Loading...
with Cargando...
{
'Loading...': 'Cargando...',
}
Finally you pass the configuration to a Notabene instance:
const notabene = new Notabene({
widget: 'https://widget.notabene.id',
container: '#container',
authToken: '{CUSTOMER_TOKEN}'
theme: {THEME},
dictionary: {DICTIONARY},
});
FAQs
JavaScript SDK for Notabene
We found that @notabene/javascript-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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.