https://github.com/avatarconnect/sdk
One toolkit to integrate every avatar project
https://github.com/avatarconnect/sdk
Last synced: 12 months ago
JSON representation
One toolkit to integrate every avatar project
- Host: GitHub
- URL: https://github.com/avatarconnect/sdk
- Owner: AvatarConnect
- License: mit
- Created: 2022-04-04T22:51:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-13T09:39:08.000Z (about 4 years ago)
- Last Synced: 2025-06-28T06:51:22.299Z (12 months ago)
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @avatarconnect/sdk [](https://npmjs.org/package/@avatarconnect/sdk)
The JavaScript sdk for integrating AvatarConnect into your web-based metaverse
## Installing
Via CDN:
```html
```
Using npm:
```bash
$ npm install @avatarconnect/sdk
```
Using bower:
```bash
$ bower install @avatarconnect/sdk
```
Using yarn:
```bash
$ yarn add @avatarconnect/sdk
```
## Usage
```javascript
import AvatarConnect from '@avatarconnect/sdk'
const connector = new AvatarConnect([
['ready-player-me', { gateway: 'mona' }],
'crypto-avatars',
'meebits',
])
// Display the AvatarConnect modal
connector.enable()
connector.on('close', handleClose)
connector.on('error', handleError)
// Pass the result into the AvatarConnect plugin for your game engine
connector.on('result', handleResult)
// Hide the AvatarConnect modal
connector.disable()
```
## API
```javascript
new AvatarConnect([, ])
```
### Providers
Check out our docs for more info on provider configurations
### Options
| Option | Description | Default |
| --------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **`bridgeUrl`** | Pass in a custom url for your own hosted version of [@avatarconnect/bridge](https://github.com/AvatarConnect/bridge) | `https://v0.avatarconnect.org` |
| **`maxHeight`** | Max height of the modal's content (in pixels) | `600` |
| **`maxWidth`** | Max width of the modal's content (in pixels) | `800` |
| **`padding`** | The padding on the sides of the modal at full width (in pixels) | `6` |