@zerohash-sdk/profile-js
v0.2.1
Published
A programmatic JavaScript SDK for integrating the Connect Profile widget into web applications without requiring HTML custom elements or a specific framework.
Readme
@zerohash-sdk/profile-js
A programmatic JavaScript SDK for integrating the Connect Profile widget into web applications without requiring HTML custom elements or a specific framework.
Installation
npm install @zerohash-sdk/profile-jsGetting Started
import { Profile } from '@zerohash-sdk/profile-js';
const profile = new Profile({
jwt: 'your-jwt-token',
env: 'prod',
theme: 'auto',
onClose: () => console.log('Closed'),
onError: ({ errorCode, reason }) => console.error(errorCode, reason),
onEvent: (event) => console.log('Event:', event),
onLoaded: () => console.log('Profile loaded'),
});
// Render to a container
await profile.render(document.getElementById('profile-container'));
// Update configuration
profile.updateConfig({ jwt: 'new-token', theme: 'dark' });
// Clean up
profile.destroy();More Information & Support
For comprehensive documentation or support about Connect, visit our Documentation Page.
