# @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

```bash
npm install @zerohash-sdk/profile-js
```

## Getting Started

```javascript
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](https://docs.zerohash.com/).
